19542022-12-12 13:08:33DragonoidOmegaÁruszállítás üres szakaszaicpp11Wrong answer 14/5079ms11588 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]--;
    }
    for(i=2;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
base14/50
1Accepted0/03ms1808 KiB
2Wrong answer0/079ms9784 KiB
3Accepted2/22ms2084 KiB
4Wrong answer0/22ms2208 KiB
5Accepted2/22ms2408 KiB
6Accepted2/22ms2612 KiB
7Accepted2/22ms2820 KiB
8Accepted2/22ms2964 KiB
9Wrong answer0/22ms3064 KiB
10Wrong answer0/22ms3268 KiB
11Accepted2/22ms3828 KiB
12Accepted2/23ms4212 KiB
13Wrong answer0/37ms4132 KiB
14Wrong answer0/38ms4856 KiB
15Wrong answer0/36ms5140 KiB
16Wrong answer0/363ms11336 KiB
17Wrong answer0/364ms11484 KiB
18Wrong answer0/371ms11440 KiB
19Wrong answer0/39ms6624 KiB
20Wrong answer0/310ms7540 KiB
21Wrong answer0/371ms11564 KiB
22Wrong answer0/375ms11588 KiB