207362026-01-08 18:25:34KoszorusBlankaÁruszállítás üres szakaszaicpp17Wrong answer 15/50400ms524 KiB
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int N, M;
    cin >> N >> M;

    vector <bool> szallitas(N+1, false);
    szallitas[0] = true;

    for (int i = 1; i <= M; i++) {
        int x,y;
        cin >> x >> y;
        for (int j = x; j <= y; j++) { szallitas[j] = true; }
    }

    int db = 0;
    for (int i = 1; i <= N; i++) {
        if (szallitas[i] == false && szallitas[i-1] == true) {db++;}
    }

    cout << db;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base15/50
1Accepted0/01ms316 KiB
2Accepted0/0104ms524 KiB
3Accepted2/21ms316 KiB
4Accepted2/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Accepted2/21ms316 KiB
8Wrong answer0/21ms316 KiB
9Accepted2/21ms316 KiB
10Accepted2/21ms404 KiB
11Accepted2/22ms316 KiB
12Wrong answer0/22ms508 KiB
13Wrong answer0/36ms316 KiB
14Wrong answer0/38ms508 KiB
15Wrong answer0/34ms316 KiB
16Time limit exceeded0/3400ms316 KiB
17Time limit exceeded0/3400ms316 KiB
18Time limit exceeded0/3400ms316 KiB
19Wrong answer0/39ms316 KiB
20Wrong answer0/310ms316 KiB
21Wrong answer0/393ms316 KiB
22Accepted3/398ms512 KiB