knakul853

Untitled

Nov 22nd, 2020
457
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  vector<pair<int,int>>p;
  2.    
  3.     for(int i=0; i<n; i++){
  4.         p.push_back({end[i], i});
  5.     }
  6.     sort(p.begin(), p.end());
  7.    
  8.     int ans = 1;
  9.     int mx = p[0].first;
  10.    
  11.     cout<<p[0].second+1<<" ";
  12.    
  13.     for(int i=1; i<n; i++){
  14.        
  15.         if(start[p[i].second] > mx){
  16.             cout<<p[i].second+1<<" ";
  17.             mx =  p[i].first;
  18.         }
  19.        
  20.     }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×