Блог пользователя kira..04

Автор kira..04, 5 часов назад, По-английски

i was trying to solve this problem and i got tle on test 12

why ?

https://mirror.codeforces.com/contest/939/submission/277938020

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

»
5 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

There are two likely cases here:

  1. Your binary search never terminates

  2. You used more than 7 query (I think this is likely since you're doing ternary search wrong)

»
5 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

You have in your code while(l <= r). This loop will never end.