19622022-12-12 13:43:52DragonoidOmegaÁruszállítás üres szakaszaicpp11Wrong answer 2/5078ms11696 KiB
#include <iostream>
#include <vector>

using namespace std;
int i,n,m,a,b,db;
int main()
{
    cin>>n>>m;
    vector <int> x(n+2);
    for(i=1;i<=m;++i)
    {
        cin>>a>>b;
        x[a]++;
        x[b]--;
    }
    x[n]=10;
    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
base2/50
1Accepted0/03ms1816 KiB
2Wrong answer0/078ms9780 KiB
3Wrong answer0/22ms2256 KiB
4Accepted2/22ms2460 KiB
5Wrong answer0/22ms2700 KiB
6Wrong answer0/22ms2864 KiB
7Wrong answer0/22ms3064 KiB
8Wrong answer0/22ms3208 KiB
9Wrong answer0/22ms3216 KiB
10Wrong answer0/22ms3212 KiB
11Wrong answer0/22ms3644 KiB
12Wrong answer0/23ms3984 KiB
13Wrong answer0/36ms3980 KiB
14Wrong answer0/38ms4628 KiB
15Wrong answer0/36ms4636 KiB
16Wrong answer0/363ms11020 KiB
17Wrong answer0/364ms11000 KiB
18Wrong answer0/371ms11284 KiB
19Wrong answer0/39ms6684 KiB
20Wrong answer0/312ms7668 KiB
21Wrong answer0/372ms11696 KiB
22Wrong answer0/375ms11644 KiB