This gives TLE
bool mod(int a,int b){
return a>=b;
}
sort(a,a+n,mod);
Whereas , this runs in 0.06 sec , why ? Does using a cmp fn make sort too slow or should i use pass by reference or something like that ?
sort(a , a+n , greater());
Only difference between the codes is the use of comparator. What can be the reason for slowdown ?