127542024-12-29 19:54:33ercseferencÁruszállítás üres szakaszaicpp17Wrong answer 15/50398ms1524 KiB
#include <iostream>
using namespace std;
bool a[10000001];
int main()
{
    int n,m,x,y;  cin>>n>>m;
    bool ures=0; int c=0;
    for(int i=0; i<m; i++){cin>>x>>y;
        for(int j=x; j<=y; j++){a[j]=1;}}
    for(int i=1; i<=n; i++){
        if(a[i]==1)ures=0;
        else if(ures==0){ures=1; c++;}
    }
    cout<<c;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base15/50
1Accepted0/01ms320 KiB
2Accepted0/076ms1336 KiB
3Accepted2/21ms320 KiB
4Accepted2/21ms508 KiB
5Wrong answer0/21ms320 KiB
6Wrong answer0/21ms320 KiB
7Accepted2/21ms320 KiB
8Wrong answer0/21ms320 KiB
9Accepted2/21ms320 KiB
10Accepted2/21ms320 KiB
11Accepted2/21ms332 KiB
12Wrong answer0/22ms508 KiB
13Wrong answer0/34ms320 KiB
14Wrong answer0/37ms508 KiB
15Wrong answer0/34ms568 KiB
16Time limit exceeded0/3384ms1272 KiB
17Time limit exceeded0/3368ms1268 KiB
18Time limit exceeded0/3398ms1044 KiB
19Wrong answer0/38ms568 KiB
20Wrong answer0/38ms824 KiB
21Wrong answer0/368ms1400 KiB
22Accepted3/371ms1524 KiB