21512022-12-25 12:00:39bzsofiaÁruszállítás üres szakaszaicpp11Wrong answer 34/5035ms20064 KiB
#include <iostream>
#include <vector>

using namespace std;

long long n, m, i, a, b, akt, db;
bool elozo;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    cin >> m >> n;

    vector <long long> x(m + 1);

    for (i = 1; i <= n; ++i)
    {
        cin >> a >> b;
        ++x[a];
        --x[b];
    }

    for (i = 1; i <= m; ++i)
    {
        akt += x[i];

        if (akt == 0 && akt-x[i] != 0)
        {
            ++db;
        }
    }

    cout << db;
}
SubtaskSumTestVerdictTimeMemory
base34/50
1Accepted0/03ms1828 KiB
2Accepted0/035ms17692 KiB
3Wrong answer0/22ms2260 KiB
4Wrong answer0/22ms2296 KiB
5Wrong answer0/22ms2428 KiB
6Wrong answer0/22ms2500 KiB
7Wrong answer0/22ms2636 KiB
8Wrong answer0/22ms2856 KiB
9Accepted2/22ms2932 KiB
10Accepted2/22ms3060 KiB
11Wrong answer0/22ms4084 KiB
12Wrong answer0/23ms4592 KiB
13Accepted3/34ms4588 KiB
14Accepted3/34ms6408 KiB
15Accepted3/34ms6540 KiB
16Accepted3/325ms19500 KiB
17Accepted3/325ms19704 KiB
18Accepted3/327ms19652 KiB
19Accepted3/36ms10420 KiB
20Accepted3/37ms12188 KiB
21Accepted3/330ms20064 KiB
22Accepted3/329ms20012 KiB