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

Автор knightandking, история, 3 года назад, По-английски

My solution (submission link) is getting the time limit exceeded while on test case 34 while being virtually identical to the editorial solution. I tried a bunch of changes but non seem to be working

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

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

Use map instead of unordered_map

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

It might be because of overflow in the binary search(the max value is 5e9, and 5e9*5e9 = 25e18, which will overflow beyond even unsigned long long). I suggest changing it to 3e9, which is enough and will not overflow.

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

use map