20102022-12-13 22:05:03neszbalÁruszállítás üres szakaszaicpp17Wrong answer 2/5078ms11968 KiB
#include <bits/stdc++.h>
using namespace std;
int n, m, d, res;
int c[1000010];
int main() {
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        c[a - 1] += 1;
        c[b] -= 1;
    }
    for (int i = 0; i < n; i++) {
        d += c[i];
        if (d == 0) {
            res += 1;
        }
    }
    cout << res << endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base2/50
1Accepted0/03ms1888 KiB
2Wrong answer0/078ms9984 KiB
3Wrong answer0/22ms2424 KiB
4Accepted2/22ms2580 KiB
5Wrong answer0/22ms2692 KiB
6Wrong answer0/22ms2916 KiB
7Wrong answer0/22ms3096 KiB
8Wrong answer0/22ms3324 KiB
9Wrong answer0/22ms3404 KiB
10Wrong answer0/22ms3372 KiB
11Wrong answer0/22ms3920 KiB
12Wrong answer0/23ms4232 KiB
13Wrong answer0/36ms4196 KiB
14Wrong answer0/38ms4940 KiB
15Wrong answer0/36ms4944 KiB
16Wrong answer0/359ms4476 KiB
17Wrong answer0/361ms4744 KiB
18Wrong answer0/368ms4804 KiB
19Wrong answer0/38ms7252 KiB
20Wrong answer0/39ms8092 KiB
21Wrong answer0/370ms11964 KiB
22Wrong answer0/372ms11968 KiB