|
|
back to boardAdmins, please check test 8 for submission 4909253 on Java Posted by d3m0n1c 19 Apr 2013 04:13 Or give me some tests please. All tests that were proposed on the forum shows correct result. The main loop is: while (head != n) { if (id[head] != -1) { int have = shop[id[head]].count; if (have > 0) { if (want[head] > have) { if (head == n - 1) { ++time; break; } swap(id[head], id[head + 1]); swap(want[head], want[head + 1]); want[head + 1] = have; } else { shop[id[head]].count = have - want[head]; ++head; } } else ++head; } else ++head; ++time; } Edited by author 19.04.2013 14:14 Edited by author 19.04.2013 14:14 Re: Admins, please check test 8 for submission 4909253 on Java I think that the problem is in the function swap() which doesn't work in Java. Re: Admins, please check test 8 for submission 4909253 on Java Posted by d3m0n1c 27 Apr 2013 00:39 Your guess is wrong. I wrote swap method. Also I used my own hashing. Maybe this is the root cause. |
|
|