19512022-12-12 12:54:21DragonoidOmegaÁruszállítás üres szakaszaicpp11Wrong answer 2/5083ms19292 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
base2/50
1Accepted0/03ms1684 KiB
2Wrong answer0/083ms17372 KiB
3Wrong answer0/22ms2052 KiB
4Accepted2/22ms2256 KiB
5Wrong answer0/22ms2456 KiB
6Wrong answer0/22ms2664 KiB
7Wrong answer0/22ms2780 KiB
8Wrong answer0/22ms2908 KiB
9Wrong answer0/22ms3156 KiB
10Wrong answer0/22ms3228 KiB
11Wrong answer0/23ms3892 KiB
12Wrong answer0/23ms4396 KiB
13Wrong answer0/37ms4676 KiB
14Wrong answer0/39ms6136 KiB
15Wrong answer0/38ms6268 KiB
16Wrong answer0/367ms19060 KiB
17Wrong answer0/368ms19080 KiB
18Wrong answer0/378ms19164 KiB
19Wrong answer0/312ms9672 KiB
20Wrong answer0/314ms11236 KiB
21Wrong answer0/379ms19292 KiB
22Wrong answer0/382ms19260 KiB