prat945's blog

By prat945, history, 2 months ago, In English

Hello everyone, please help me debug this code (https://codeforces.com/contest/1539/submission/123994140). I have implemented this using two pointer method, and I believe that the logic is correct. I have also used a random test case generator and compared my solution with an accepted one , but to no avail. Any help/suggestion/support on this is greatly appreciated. Any general debugging tips are also appreciated. Thanks!

 
 
 
 
  • Vote: I like it
  • +5
  • Vote: I do not like it

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

Try changing pair<int, int> to pair<long long, long long> in the comparator.

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

Oh! I feel so stupid right now. Anyway , thanks a lot I got AC.