Quirkless's blog

By Quirkless, history, 3 years ago, In English

Hey, can someone find reason for "runtime error on test 5" for this submission https://codeforces.me/contest/559/submission/139264120 for problem https://codeforces.me/contest/559/problem/C I couldn't find it, please help.

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

»
3 years ago, # |
  Vote: I like it +11 Vote: I do not like it

sortbysec violates rules for comparison functions passable to std::sort

  • »
    »
    3 years ago, # ^ |
    Rev. 5   Vote: I like it +8 Vote: I do not like it

    sorry bro, but I didn't got you. Can you explain more, or refer to some link where I can study about this rule violation thing.

    UPD: thanks, I got rid of at least runtime error.

    UPD-2:Finally, got AC. And, thanks a lot bro, you guys are awesome. There was no way I could have figured reason by myself. This community is awesome!

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      A comparison function should return true if the first argument is less than (i.e. is ordered before) the second in the strict ordering relation, and false otherwise.