Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <queue>
- #include <algorithm>
- #include <vector>
- #include <algorithm>
- #include <set>
- #include <cstring>
- #include <map>
- using namespace std;
- typedef long long ll;
- int main(){
- ios_base::sync_with_stdio(false);
- int n;
- cin >> n;
- int a, b;
- map<int, int> mapa;
- for(int i = 0; i < n; i++) {
- cin >> a >> b;
- mapa[a]++;
- mapa[b + 1]--;
- }
- int ans = 0;
- int sum = 0;
- for(auto x : mapa) {
- sum += x.second;
- ans = max(ans, sum);
- }
- cout << ans << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement