-
Couldn't load subscription status.
- Fork 269
Open
Description
UVa/volume117/11729 - Commando War.cpp
Lines 7 to 9 in 080fb3a
| bool cmp(pt a, pt b) { | |
| return a.y > b.y; | |
| } |
The above code fails to provide consistent sorting order when y is the same for different x. For example -
3
3 10
2 10
1 10
Comparator must be -
if(a.y == b.y) { return a.x < b.x; } return a.y > b.y;
Metadata
Metadata
Assignees
Labels
No labels