This is an interactive problem, so the input data may not be fixed.
i.e. the location of the center may change each time you submit your
solution.
Since you have a bug in your code (not correctly handle the right bounday),
so in rare cases, your solution would fail.
--
You received this
This doesn't make sense though, because I always check (0, 0) for a HIT
first, which should always be True in the first two test sets. Therefore,
none of the "random generator" part of the code is ever executed in those
test sets.
On Monday, 20 April 2020 18:05:54 UTC-4, porker2008 wrote:
>
>
Thanks for catching this. But this doesn't explain why the code passes the
Test Sets all but once.
On Monday, 20 April 2020 18:09:47 UTC-4, porker2008 wrote:
>
> Also, your *binary_search_right()* is incorrect, it fails when *left =
> 10**9 - 1* and *func(10**9)* is *HIT*
> In this case, it
Also, your *binary_search_right()* is incorrect, it fails when *left =
10**9 - 1* and *func(10**9)* is *HIT*
In this case, it returns *10**9 - 1* instead of *10**9*
Wrong implementation:
*def binary_search_right(self, left, func):*
*right = 10**9*
*while left < right:*
*m = (left
While test data is not random, your solution is.
It is very likely that you have a bug in your code that in some cases, the
random number you generated cause your program to behave incorrectly.
--
You received this message because you are subscribed to the Google Groups
"Google Code Jam"