19442022-12-12 12:51:03DragonoidOmegaÁruszállítás üres szakaszaicpp11Wrong answer 14/5086ms19288 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]--;
    }
    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
base14/50
1Accepted0/03ms1812 KiB
2Wrong answer0/086ms17576 KiB
3Accepted2/22ms2260 KiB
4Wrong answer0/22ms2460 KiB
5Accepted2/22ms2612 KiB
6Accepted2/22ms2768 KiB
7Accepted2/22ms2852 KiB
8Accepted2/22ms2916 KiB
9Wrong answer0/22ms3000 KiB
10Wrong answer0/22ms3000 KiB
11Accepted2/22ms3812 KiB
12Accepted2/23ms4220 KiB
13Wrong answer0/37ms4220 KiB
14Wrong answer0/38ms5784 KiB
15Wrong answer0/37ms5784 KiB
16Wrong answer0/364ms18720 KiB
17Wrong answer0/367ms18720 KiB
18Wrong answer0/375ms19124 KiB
19Wrong answer0/310ms9384 KiB
20Wrong answer0/314ms11200 KiB
21Wrong answer0/379ms19288 KiB
22Wrong answer0/382ms19280 KiB