Its been quite a long time since i got inspiration to solve SPOJ problems. Then i hear about this problem and how binary search could create problems in it. So deciding to give it a go (c’mon how tough can binary search be??) i start coding it up. About 20 wrong attempts on my PC and TLE exceeded 5 times on SPOJ, finally realised i was doing binary search on the quantity with a smaller bounds and normal iteration through the one with larger bounds. .!!! One wrong submission later (submitted it in ADA instead of c++ ) finally got ACC. .
The problem can be found here. .
http://www.spoj.pl/problems/AGGRCOW/
Cheers
The problem can be found here. .
http://www.spoj.pl/problems/AGGRCOW/
Cheers
hi
ReplyDeletei am getting WA in AGGRCOW
used binary search concept
is there any special test case ???
Not as far as i know. . Once i figured out the right quantity to binary search on, i got ACC. .
DeleteActually i had made the binary search to find the max. partition size posiible.
DeleteNow i am making partitions to divide the distance among partitions.
How to handle the cases where the some of the partitions will be left blank ???