Created
May 20, 2019 15:36
-
-
Save Thiago4532/0d5d5e90e85bbf76154508f1ba8acf9f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int a[100100], b[100100], v[100100]; | |
int main() { | |
int n, ans = 0; | |
cin >> n; | |
for(int i = 0; i < n; i++){ | |
cin >> a[i] >> b[i]; | |
} | |
for(int i = 0; i < n; i++){ | |
for(int j = a[i]; j <= b[i]; j++){ | |
v[j]++; | |
} | |
} | |
for(int i = 1; i <= 100000; i++){ | |
ans = max(ans, v[i]); | |
} | |
cout << ans << "\n"; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment