Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- #define MAXYEAR 2020
- int n, fr[MAXYEAR];
- int main() {
- cin >> n;
- for (int i = 1; i <= n; i++) {
- int a, b;
- cin >> a >> b;
- for (int y = a; y <= b; y++)
- fr[y]++;
- }
- int maxi = 0, ry;
- for (int y = 1; y <= MAXYEAR; y++)
- if (maxi < fr[y]) {
- maxi = fr[y];
- ry = y;
- }
- cout << ry << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement