Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector<pair<int,int>>p;
- for(int i=0; i<n; i++){
- p.push_back({end[i], i});
- }
- sort(p.begin(), p.end());
- int ans = 1;
- int mx = p[0].first;
- cout<<p[0].second+1<<" ";
- for(int i=1; i<n; i++){
- if(start[p[i].second] > mx){
- cout<<p[i].second+1<<" ";
- mx = p[i].first;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement