Sederam's blog

By Sederam, history, 17 months ago, In English

does anybody know what the problem with this code? (runtime error!!) Your text to link here...

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
17 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Sederam (previous revision, new revision, compare).

»
17 months ago, # |
Rev. 4   Vote: I like it +21 Vote: I do not like it

https://codeforces.net/blog/entry/70237

Your comparator function cmp currently returns true if the two elements to be compared are equal. C++ requires you to have comparators return false for equal elements. You just need to replace $$$\le$$$ with $$$<$$$ to fix the RTE.

Fixing this gives WA2.