Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Comp {
- bool operator()(const std::pair<int, int> &a, const std::pair<int, int> &b) {
- if (a.first != b.first) {
- return a.first < b.first;
- }
- return a.second > b.second;
- }
- };
- Comp comp_functor;
- std::sort(myVec.begin(), myVec.end(), comp_functor);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement