you can also specify a function object as a comparator, which you can create before calling the sort function. For example:
struct { bool operator()(int a, int b) const { return a < b; } }cmp;
1000 ms 32 Mb Rules for program design and list of errors in automatic problem checking