80432024-01-12 11:23:18David9320Áruszállítás (75 pont)cpp17Wrong answer 0/75115ms5600 KiB
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;
    int eredmeny = 0;

    bool palya[n + 1];

    for(int i = 0; i < m; i++) {
        int x, y;
        cin >> x >> y;
        for(int i = x; i < y; i++) {
            palya[i] = true;
        }
    }

    for(int i = 1; i <= n; i++) {
        if(!palya[i]) {
            eredmeny++;
        }
    }

    cout << eredmeny - 1;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/75
1Wrong answer0/03ms1872 KiB
2Wrong answer0/074ms4064 KiB
3Wrong answer0/33ms2560 KiB
4Wrong answer0/33ms2652 KiB
5Wrong answer0/33ms2636 KiB
6Wrong answer0/33ms2636 KiB
7Wrong answer0/33ms2684 KiB
8Wrong answer0/43ms3172 KiB
9Wrong answer0/43ms3180 KiB
10Wrong answer0/43ms3280 KiB
11Wrong answer0/43ms3444 KiB
12Wrong answer0/43ms3284 KiB
13Wrong answer0/47ms3584 KiB
14Wrong answer0/48ms3784 KiB
15Wrong answer0/46ms3736 KiB
16Wrong answer0/461ms3944 KiB
17Wrong answer0/479ms4296 KiB
18Wrong answer0/4115ms4404 KiB
19Wrong answer0/48ms4324 KiB
20Wrong answer0/49ms4660 KiB
21Wrong answer0/467ms5600 KiB
22Wrong answer0/470ms5600 KiB