I did exactly what you did in the first version. The only thing you didn't name was to check the fuel used between the start (or last gas station) and the goal. Other than that, I don't see any difference. Maybe add some epsilon when you print the result.
Yes, if you increase the distance between them, the radius becomes larger. But if you make it smaller, eventually the upper 'v' also makes the circle bigger. With ternary search you can get the optimum distance.
It's more like a DP problem, think about what states you have, a robot can be destroyed or not, and for any combination of destroyed robots you can destroy others (independently of the order they were destroyed). I hope it was helpful.
That was the problem (the two of them). I could say it directly, but people here don't let it be so easy. By the way, you have to keep trying, I needed several months to get one accepted and I have ~350 problems accepted by now.
And yes, you should delete the code after you got it accepted.
I'm sorry, I should be more clear. We get this from the problem, ln(n) = L + ln(1 - x) => n = e^L * (1 - x) Also we have this, |x| < 1 => -1 < x < 1 => 0 < 1 - x < 2 Then, e^L * (1 - x) < 2 * e^L => n < 2 * e^L => ln(n) < ln(2) + L => ln(n) - ln(2) < L Since we don't get (or I didn't see) any other ...