sort comp() vs sort()

Revision en1, by rahul_1234, 2015-12-21 16:07:36

In the problem https://www.codechef.com/problems/CHEFQUE,

submission : https://ideone.com/l2LPvy got TLE. It used comp().

However, when I didn't use comp() and just used sort( vc.begin(), vc.end() ) it got accepted. Submission link https://ideone.com/NgbwUO.

Even though both are doing same thing, why comp() is giving TLE and how can we improve on it. Please somebody guide me on this.

Tags sort

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English rahul_1234 2015-12-21 16:07:36 423 Initial revision (published)