Why Runtime error?

Revision en1, by lequydon, 2025-01-30 14:30:00

I was working on this problem: https://codeforces.me/problemset/problem/547/B

My first submission is: https://codeforces.me/problemset/submission/547/303635124

This code resulted runtime error on test 49

However, when I removed the equal sign in my comparator function:

bool cmp(int x, int y){ return a[x] <= a[y]; }

My new submision is: https://codeforces.me/problemset/submission/547/303635252

The code was accepted! Can anyone explain why this change made a difference? Thanks!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English lequydon 2025-01-30 14:30:00 535 Initial revision (published)