Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define int int64_t
- using namespace std;
- int32_t main() {
- int n;
- cin >> n;
- map<pair<int, int>, int> v;
- for(int i = 0; i < n; i++){
- int x, y;
- cin >> x >> y;
- v[{x, y}]++;
- }
- int ans = 0, r = LLONG_MIN;
- for(auto i: v){
- if (r < i.first.second)
- ans++;
- r = max(r, i.first.second);
- }
- cout << ans;
- }
Advertisement
Add Comment
Please, Sign In to add comment