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

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

Here's the problem:

166A - Ранклист

The same codes are having different verdicts here,

submission:113596205

113554437 (WA on test 15)

113536634 (WA on test 15)

Accepted one is in C++17(64). Rest two are in C++17 and C++14. I use sublime text and Your text to link here... Both gives correct output for test 15 in C++14 and other versions. But This problem's verdict and custom invocation shows me wrong. I wonder what's the deal here?

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

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

Your comparator doesn't meet the compare requirements. Shortly, cmp(A,B) should return true only if object A is strictly less than object B. In particular, cmp(A, A) must always return false. Otherwise it will lead to undefined behavior and that's exactly what you've got.

So just change 1 symbol and it turns into AC: 117936962

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