19632022-12-12 13:45:44DragonoidOmegaÁruszállítás üres szakaszaicpp11Wrong answer 34/5076ms11936 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=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
base34/50
1Accepted0/03ms1680 KiB
2Accepted0/076ms9656 KiB
3Wrong answer0/22ms2052 KiB
4Wrong answer0/22ms2236 KiB
5Wrong answer0/22ms2440 KiB
6Wrong answer0/22ms2644 KiB
7Wrong answer0/22ms2848 KiB
8Wrong answer0/22ms3052 KiB
9Accepted2/22ms3168 KiB
10Accepted2/22ms3412 KiB
11Wrong answer0/22ms3596 KiB
12Wrong answer0/23ms3948 KiB
13Accepted3/37ms4212 KiB
14Accepted3/38ms4808 KiB
15Accepted3/37ms4784 KiB
16Accepted3/365ms11412 KiB
17Accepted3/363ms11436 KiB
18Accepted3/371ms11612 KiB
19Accepted3/39ms6884 KiB
20Accepted3/310ms8096 KiB
21Accepted3/370ms11936 KiB
22Accepted3/371ms11868 KiB