I accepted this problem during the training using a solution.
When I read the model solutions submitted by Mike, I found they are brute force too. And It will failed on a easy case n = 218 - 1, ai = i, bi = i + 1.
Only my solution and Los_Angelos_Laycurse's solution pass this case.
I think we implemented more clever brute force solutions.
But I don't know how to prove my solution is right or construct some hard cases to make my solution TLE.
I really want to know: Is there any provable solution to solve this problem?
.
Come! On! Stop solving every single problem under the sun. I will never reach you guys this way.
YES INDEED , You will NEVER reach these guys if you keep thinking this way -_-
I'll keep thinking like this. Let's see what happens. :3
As far as I know, the intended solution is and the problem author is ilyakor.
Can you share some insights about that solution? I am really curious