TLE on 1530D. Secret Santa

Revision en2, by whatthemomooofun1729, 2023-07-01 02:59:11

Hi, I am working on 1530D and I'm not sure why this code gets TLE on test case 4. I've calculated the time complexity several times, and it looks like O(NLogN) (there is a nested loop but it only goes through N iterations in total, and in each iteration we do an O(logN) binary search). I've also tried fast I/O, but that didn't work. Does anybody know why this code is getting TLE? Thank you!

Tags tle

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English whatthemomooofun1729 2023-07-01 02:59:11 54
en1 English whatthemomooofun1729 2023-07-01 02:56:45 477 Initial revision (published)