238062026-01-29 22:31:47BucsMateTelefonközpont (40 pont)cpp17Accepted 40/4079ms1968 KiB
#include <iostream>

using namespace std;

int t[400002] = {};

int main()
{
    int N;
    cin >> N;
    for(int i = 0; i < N; i++){
        int a, b;
        cin >> a >> b;
        t[a]++;
        t[b+1]--;
    }
    int result = 0;
    for(int i = 1; i <= 400000; i++){
        t[i] = t[i-1] + t[i];
        result = max(result, t[i]);
    }
    cout << result;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms1844 KiB
2Accepted0/079ms1860 KiB
3Accepted2/23ms1844 KiB
4Accepted2/23ms1844 KiB
5Accepted2/23ms1844 KiB
6Accepted2/214ms1964 KiB
7Accepted2/241ms1968 KiB
8Accepted3/339ms1964 KiB
9Accepted3/352ms1844 KiB
10Accepted3/370ms1844 KiB
11Accepted3/375ms1844 KiB
12Accepted3/337ms1944 KiB
13Accepted3/374ms1928 KiB
14Accepted3/337ms1840 KiB
15Accepted3/339ms1944 KiB
16Accepted3/371ms1900 KiB
17Accepted3/375ms1844 KiB