19592022-12-12 13:38:07DragonoidOmegaÁruszállítás üres szakaszaicpp11Wrong answer 34/5078ms11652 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
base34/50
1Accepted0/03ms1812 KiB
2Accepted0/078ms9924 KiB
3Wrong answer0/22ms2268 KiB
4Wrong answer0/22ms2404 KiB
5Wrong answer0/22ms2608 KiB
6Wrong answer0/22ms2752 KiB
7Wrong answer0/22ms2956 KiB
8Wrong answer0/22ms3160 KiB
9Accepted2/22ms3236 KiB
10Accepted2/22ms3304 KiB
11Wrong answer0/22ms3488 KiB
12Wrong answer0/23ms3888 KiB
13Accepted3/36ms3880 KiB
14Accepted3/38ms4528 KiB
15Accepted3/36ms4532 KiB
16Accepted3/361ms11152 KiB
17Accepted3/364ms11360 KiB
18Accepted3/371ms11388 KiB
19Accepted3/39ms6628 KiB
20Accepted3/312ms7868 KiB
21Accepted3/371ms11624 KiB
22Accepted3/372ms11652 KiB