ProgMe

Untitled

Nov 28th, 2020
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. #define int int64_t
  4.  
  5. using namespace std;
  6.  
  7. int32_t main() {
  8. int n;
  9. cin >> n;
  10. map<pair<int, int>, int> v;
  11. for(int i = 0; i < n; i++){
  12. int x, y;
  13. cin >> x >> y;
  14. v[{x, y}]++;
  15. }
  16. int ans = 0, r = LLONG_MIN;
  17. for(auto i: v){
  18. if (r < i.first.second)
  19. ans++;
  20. r = max(r, i.first.second);
  21. }
  22. cout << ans;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment