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

Автор kinitic013, история, 21 месяц назад, По-английски

I recently read this blog and tried to implement this data structure in problem 455D - Serega and Fun mentioned in comments but it's getting WA and I can't seem to find any bug in my data structure implementation , I know asking you all to debug my code is not good but it's a desperate move :<(

303760090 In my implementation i havn't stored size of each block as in the problem we are swapping so there's never going to be too many or too less blocks

Spoiler Code
  • Проголосовать: нравится
  • -13
  • Проголосовать: не нравится

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

One of the issues came from your square root implementation, you are setting l=0,r=5000000001, which in the first iteration we get mid=(5000000001)/2=2500000000 square that and we get integer overflow, you should set r=1000000001 instead.