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

Автор tenshi_kanade, история, 9 лет назад, По-английски

I experienced a strange WA on 576C - Points on Plane.

Compare these two submissions: 13000332 and 13000388. They are exactly the same, except that one submission had comparators <= and >=, while the other had comparators < and >. There shouldn't be any undefined behaviour as far as I can see, so I'm wondering why the WA in the first submission.

This would have been very frustrating had it been during a contest... Is there anything I'm missing here?

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

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

http://en.cppreference.com/w/cpp/algorithm/sort

Compare must meet the requirements of Compare.

http://en.cppreference.com/w/cpp/concept/Compare

If comp(a,b)==true then comp(b,a)==false