74822024-01-09 10:18:28madvirÁruszállítás üres szakaszaicpp17Wrong answer 25/50400ms12292 KiB
#include <iostream>

using namespace std;

int main()
{
    int n, m, x, y, card=0;
    cin >> n >> m;
    int a[n]={0};
    for(int i=0; i<m; i++) {
        cin >> x >> y;
        for(int j=x; j<y; j++) {
            a[j]++;
        }
    }
    for(int i=0; i<n-1; i++) {
        if(a[i]==0 && a[i+1]!=0) card++;
    }

    cout << endl << card << endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base25/50
1Accepted0/03ms1916 KiB
2Accepted0/089ms10020 KiB
3Wrong answer0/23ms2364 KiB
4Wrong answer0/23ms2492 KiB
5Wrong answer0/23ms2704 KiB
6Wrong answer0/23ms2784 KiB
7Wrong answer0/23ms3036 KiB
8Wrong answer0/23ms3120 KiB
9Accepted2/23ms3004 KiB
10Accepted2/23ms3000 KiB
11Wrong answer0/23ms3472 KiB
12Wrong answer0/23ms3988 KiB
13Accepted3/37ms4196 KiB
14Accepted3/38ms5152 KiB
15Accepted3/37ms5368 KiB
16Time limit exceeded0/3400ms7088 KiB
17Time limit exceeded0/3365ms7168 KiB
18Time limit exceeded0/3361ms7180 KiB
19Accepted3/310ms7156 KiB
20Accepted3/312ms8144 KiB
21Accepted3/379ms12016 KiB
22Accepted3/383ms12292 KiB