Runtime Time Error due to customize in sort function

Правка en3, от uttom, 2017-05-17 05:39:01

Problem Accepted Solution Runttime error code

I sort some value that are stored in some vector(2D) lst[]

bool cmp(i64 a,i64 b){
 return a>b
}
sort(lst[i].begin(),lst[i].end(),cmp)

This is my accepted code customize sort

In second code

bool cmp(i64 a,i64 b){
 return a>=b
}
sort(lst[i].begin(),lst[i].end(),cmp)
This code got Runtime error.

My question is that if my customize funtion in 2nd code is

wrong then My verdict will be Wrong but why Runtime Error. Thanks in Advance.

Теги mysterious runtime error

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский uttom 2017-05-17 05:39:01 1 Tiny change: ' return a>b\n}\nsort' -> ' return a>=b\n}\nsort'
en2 Английский uttom 2017-05-17 05:37:37 33
en1 Английский uttom 2017-05-17 05:36:08 747 Initial revision (published)