19602022-12-12 13:39:54DragonoidOmegaÁruszállítás üres szakaszaicpp11Wrong answer 2/5079ms11988 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
base2/50
1Accepted0/03ms1812 KiB
2Wrong answer0/079ms9780 KiB
3Wrong answer0/22ms2260 KiB
4Accepted2/22ms2464 KiB
5Wrong answer0/22ms2668 KiB
6Wrong answer0/22ms2876 KiB
7Wrong answer0/22ms2948 KiB
8Wrong answer0/22ms3060 KiB
9Wrong answer0/22ms3064 KiB
10Wrong answer0/22ms3188 KiB
11Wrong answer0/22ms3712 KiB
12Wrong answer0/23ms4400 KiB
13Wrong answer0/36ms4172 KiB
14Wrong answer0/38ms4820 KiB
15Wrong answer0/36ms4828 KiB
16Wrong answer0/364ms11452 KiB
17Wrong answer0/364ms11744 KiB
18Wrong answer0/371ms11680 KiB
19Wrong answer0/39ms7052 KiB
20Wrong answer0/312ms7964 KiB
21Wrong answer0/371ms11732 KiB
22Wrong answer0/374ms11988 KiB