Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <string>
- #include <map>
- #include <assert.h>
- #include <algorithm>
- using namespace std;
- typedef struct {
- int index;
- int a;
- int b;
- } test;
- bool cmp( test a, test b) {
- if(a.a==b.a) {
- return a.b<b.b;
- }
- return a.a<b.b;
- }
- int main() {
- int t;
- vector<test> arr;
- int n;
- cin>>n;
- for(int i=0;i<n;i++) {
- test tmp;
- cin>>tmp.index>>tmp.a>>tmp.b;
- arr.push_back(tmp);
- }
- sort(arr.begin(),arr.end(),cmp);
Add Comment
Please, Sign In to add comment