129052025-01-03 11:39:26GundischBalazsÁruszállítás üres szakaszaicpp17Wrong answer 0/5071ms724 KiB
#include <iostream>

using namespace std;
int aru[1000001]={ 0 };
int main()
{
    int n, m, db=0;
    cin >> n >> m;
    int x, y;
    aru[n] = 1;

    for (int i = 1; i <= m; i++) {
        cin >> x >> y;
        for(int j=x;j<n;j++)
        {
            aru[i]++;
        }
    }
    for (int i = 1; i <= n; i++) {
        if (aru[i]==0 and aru[i+1]==0) {
            i++;db++;
        }
    }
    cout << db;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/01ms500 KiB
2Wrong answer0/071ms568 KiB
3Wrong answer0/21ms320 KiB
4Wrong answer0/21ms320 KiB
5Wrong answer0/21ms320 KiB
6Wrong answer0/21ms320 KiB
7Wrong answer0/21ms320 KiB
8Wrong answer0/21ms320 KiB
9Wrong answer0/21ms320 KiB
10Wrong answer0/21ms320 KiB
11Wrong answer0/21ms320 KiB
12Wrong answer0/21ms320 KiB
13Wrong answer0/34ms444 KiB
14Wrong answer0/37ms320 KiB
15Wrong answer0/34ms432 KiB
16Wrong answer0/357ms492 KiB
17Wrong answer0/359ms724 KiB
18Wrong answer0/367ms696 KiB
19Wrong answer0/37ms452 KiB
20Wrong answer0/38ms660 KiB
21Wrong answer0/364ms568 KiB
22Wrong answer0/367ms704 KiB