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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    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/0241ms32000 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/21ms316 KiB
10Wrong answer0/21ms316 KiB
11Wrong answer0/217ms2996 KiB
12Wrong answer0/229ms4552 KiB
13Wrong answer0/343ms4712 KiB
14Wrong answer0/387ms8800 KiB
15Wrong answer0/379ms8848 KiB
16Runtime error0/3237ms32000 KiB
17Runtime error0/3240ms32000 KiB
18Runtime error0/3237ms32000 KiB
19Wrong answer0/3216ms19004 KiB
20Wrong answer0/3261ms23860 KiB
21Runtime error0/3240ms32000 KiB
22Runtime error0/3240ms32000 KiB