Runtime Time Error due to customize in sort function

Revision en1, by uttom, 2017-05-17 05:36:08

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.

Tags mysterious runtime error

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English uttom 2017-05-17 05:39:01 1 Tiny change: ' return a>b\n}\nsort' -> ' return a>=b\n}\nsort'
en2 English uttom 2017-05-17 05:37:37 33
en1 English uttom 2017-05-17 05:36:08 747 Initial revision (published)