|
|
back to boardStrange - not so simple if u use sqrt - TL(+) My solution using sqrt (in C++ using cin and cout) failed because ot TL - it's the same solution that they suggest bellow!!! O( N * sqrt(2^31)) Then i did it with binary search : O( N * log2(2^31) AC in 0.5secs Just curious what are the AC times for the sqrt method. Re: Strange - not so simple if u use sqrt - TL(+) Posted by Madhav 14 Jun 2008 13:34 mine got accepted in 0.109sec using sqrt() func. Edited by author 14.06.2008 13:35 Re: Strange - not so simple if u use sqrt - TL(+) i've got AC in 0.078. I used the binary_search and array with positions of "1" Re: Strange - not so simple if u use sqrt - TL(+) 0.031 seconds, using one sqrt per line of input |
|
|