rurixx's blog

By rurixx, history, 3 years ago, In Russian

I was solving 1684D - Traps of recent contest and have faced with strange thing.

Pls look at two pairs of submissions. (There are very simple code)

  1. 157815234 — OK, 157815120 — Time limit

  2. 157814018 — OK, 157813947 — Run-time error

In both pairs codes' difference is the same: 'wrong' submission uses lambda function with operator >= instead of > in 'good' submission.

Can it be explained?

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

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

if comparator returns true for (a, b) it should return false for (b, a). otherwise it's undefined behavior