A Confusing problem about F Magnets from Global Round 13.

Revision en4, by yuyue, 2021-03-01 09:49:15

I came up with almost the same idea as the editorial . The only difference is that I queried $$$i$$$ and $$$i+1,i+2,...,n$$$ to find a magnet (I think it will be either the first or the second of them),instead of $$$i$$$ and $$$1,2,3,...,i-1$$$.And then I used the same approach just as the editorial says.

However,I got TLE on test 6. qwq

Today,I did a binary search on test 6.I get the test case that made me TLE, but it passed when I tested it locally.

I do wonder why it goes wrong.

You check my submission here 108735158

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en6 English yuyue 2021-03-01 09:50:51 0 (published)
en5 English yuyue 2021-03-01 09:50:41 1
en4 English yuyue 2021-03-01 09:49:15 470
en3 English yuyue 2021-03-01 09:24:18 0
en2 English yuyue 2021-03-01 09:24:18 41
en1 English yuyue 2021-03-01 09:22:00 214 Initial revision (saved to drafts)