19422022-12-12 12:49:22DragonoidOmegaÁruszállítás üres szakaszaicpp11Wrong answer 24/5086ms19352 KiB
#include <iostream>
#include <vector>

using namespace std;
int i,n,m,a,b,db;
int main()
{
    cin>>n>>m;
    vector <long long> x(n+2);
    for(i=1;i<=m;++i)
    {
        cin>>a>>b;
        x[a]++;
        x[b+1]--;
    }
    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
base24/50
1Accepted0/03ms1812 KiB
2Accepted0/086ms17524 KiB
3Accepted2/22ms2104 KiB
4Accepted2/22ms2176 KiB
5Wrong answer0/22ms2308 KiB
6Wrong answer0/22ms2512 KiB
7Accepted2/22ms2716 KiB
8Wrong answer0/22ms2796 KiB
9Accepted2/22ms2916 KiB
10Accepted2/22ms2996 KiB
11Accepted2/22ms3816 KiB
12Wrong answer0/23ms4220 KiB
13Wrong answer0/37ms4480 KiB
14Wrong answer0/38ms6064 KiB
15Wrong answer0/37ms6116 KiB
16Accepted3/364ms19052 KiB
17Accepted3/365ms19132 KiB
18Accepted3/374ms19352 KiB
19Wrong answer0/310ms9936 KiB
20Wrong answer0/313ms11280 KiB
21Wrong answer0/375ms19208 KiB
22Accepted3/379ms19132 KiB