Блог пользователя Quirkless

Автор Quirkless, история, 3 года назад, По-английски

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

  • Проголосовать: нравится
  • +8
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится +11 Проголосовать: не нравится

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

  • »
    »
    3 года назад, # ^ |
    Rev. 5   Проголосовать: нравится +8 Проголосовать: не нравится

    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 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      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.