Блог пользователя giantweekbold

Автор giantweekbold, 4 года назад, По-английски

I cannot for the life of me find the reason for which this submission below is getting TLE, could anyone help?

https://mirror.codeforces.com/contest/1476/submission/105936603

Any sort of information would be very useful, I have resubmitted since the contest ended, but to no avail.

Initial thoughts such as infinite recursion (whether it's calling itself again, or indexing above n etc.) seem infeasible because of the constraints imposed. Basically, if I am exploring to the right, I will only keep moving right, so it should not call itself again.

I have tested it extensively with different values of n, and always terminates instantly. The fact that Codeforces shows the output from the program makes me suspicious that it is something else. does anyone know the issue?

Thank you kindly.

(p.s. ignore some typos in the brainstorm at the top).

Полный текст и комментарии »

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится