19472022-12-12 12:52:32DragonoidOmegaÁruszállítás üres szakaszaicpp11Wrong answer 9/5086ms19792 KiB
#include <iostream>
#include <vector>

using namespace std;
int i,n,m,a,b,db;
int main()
{
    cin>>n>>m;
    vector <long long> x(n+2);
    for(i=1;i<=m;++i)
    {
        cin>>a>>b;
        x[a]++;
        x[b+1]--;
    }
    ++n;
    for(i=1;i<=n;++i)
    {
        x[i]+=x[i-1];
        if(x[i]==0 && x[i-1]!=0) db++;
    }
    if(x[1]==0) ++db;
    cout<<db;
}
SubtaskSumTestVerdictTimeMemory
base9/50
1Accepted0/03ms1684 KiB
2Wrong answer0/086ms17452 KiB
3Accepted2/22ms2052 KiB
4Wrong answer0/22ms2260 KiB
5Wrong answer0/22ms2460 KiB
6Wrong answer0/22ms2668 KiB
7Accepted2/22ms2904 KiB
8Wrong answer0/22ms3112 KiB
9Wrong answer0/22ms3312 KiB
10Wrong answer0/22ms3516 KiB
11Accepted2/23ms4520 KiB
12Wrong answer0/23ms5308 KiB
13Wrong answer0/37ms5264 KiB
14Wrong answer0/38ms6828 KiB
15Wrong answer0/37ms6824 KiB
16Wrong answer0/364ms19560 KiB
17Wrong answer0/368ms19644 KiB
18Wrong answer0/375ms19648 KiB
19Wrong answer0/312ms10416 KiB
20Wrong answer0/313ms11924 KiB
21Accepted3/379ms19792 KiB
22Wrong answer0/382ms19712 KiB