140942025-01-09 18:34:08Podlipnik07Áruszállítás üres szakaszaicpp17Runtime error 2/50264ms32000 KiB
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    #define int long long
    int n, m; cin >> n >> m;
    set<int> path;
    for (int i = 0; i < n; i++) {
        path.insert(i + 1);
    }
    for (int i = 0; i < m; i++) {
        int from, to;
        cin >> from >> to;
        for (int j = from; j <= to; j++) {
            path.erase(j);
        }
    }
    cout << path.size();
}
//10 4
//8 9
//1 6
//1 3
//3 4
SubtaskSumTestVerdictTimeMemory
base2/50
1Accepted0/01ms316 KiB
2Runtime error0/0246ms32000 KiB
3Wrong answer0/21ms316 KiB
4Accepted2/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/21ms316 KiB
8Wrong answer0/21ms316 KiB
9Wrong answer0/21ms508 KiB
10Wrong answer0/21ms316 KiB
11Wrong answer0/217ms2968 KiB
12Wrong answer0/230ms4592 KiB
13Wrong answer0/343ms4684 KiB
14Wrong answer0/390ms8756 KiB
15Wrong answer0/385ms8796 KiB
16Runtime error0/3239ms32000 KiB
17Runtime error0/3240ms32000 KiB
18Runtime error0/3246ms32000 KiB
19Wrong answer0/3219ms19172 KiB
20Wrong answer0/3264ms23768 KiB
21Runtime error0/3246ms32000 KiB
22Runtime error0/3246ms32000 KiB