74842024-01-09 10:24:05szabelrÁruszállítás üres szakaszaicpp17Wrong answer 15/50367ms19844 KiB
#include <iostream>

using namespace std;
long long aru[1000001]{0};
int main()
{
    long long n,m,db=0;
    cin>>n>>m;
    int x,y;
    for(int i=1; i<=m; i++){
        cin>>x>>y;
        for(int z=x; z<=y; z++){
            aru[z]++;
        }
    }
    for(int i=1; i<=n; i++){
        if(aru[i]==0 and aru[i+1]!=0){
            db++;
        }
        if(aru[i]==0 and i==n)
            db++;

    }
    cout<<db;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base15/50
1Accepted0/03ms1876 KiB
2Accepted0/096ms17692 KiB
3Accepted2/23ms2192 KiB
4Accepted2/23ms2536 KiB
5Wrong answer0/23ms2600 KiB
6Wrong answer0/23ms2844 KiB
7Accepted2/23ms2940 KiB
8Wrong answer0/23ms3168 KiB
9Accepted2/23ms3404 KiB
10Accepted2/23ms3560 KiB
11Accepted2/23ms3956 KiB
12Wrong answer0/23ms5184 KiB
13Wrong answer0/38ms5556 KiB
14Wrong answer0/39ms6660 KiB
15Wrong answer0/37ms6676 KiB
16Time limit exceeded0/3363ms3828 KiB
17Time limit exceeded0/3367ms3620 KiB
18Time limit exceeded0/3358ms4172 KiB
19Wrong answer0/312ms10316 KiB
20Wrong answer0/314ms11828 KiB
21Wrong answer0/387ms19728 KiB
22Accepted3/392ms19844 KiB