74832024-01-09 10:21:36szabelrÁruszállítás üres szakaszaicpp17Wrong answer 9/50381ms19008 KiB
#include <iostream>

using namespace std;
long long aru[1000001]{0};
int main()
{
    long long n,m,db=0;
    cin>>n>>m;
    int x,y;
    for(int i=1; i<=m; i++){
        cin>>x>>y;
        for(int z=x; z<=y; z++){
            aru[z]++;
        }
    }
    for(int i=1; i<=n; i++){
        if(aru[i]==0 and aru[i+1]!=0){
            db++;
        }

    }
    cout<<db;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base9/50
1Wrong answer0/03ms2024 KiB
2Accepted0/092ms17788 KiB
3Wrong answer0/23ms2384 KiB
4Accepted2/23ms2596 KiB
5Wrong answer0/23ms2592 KiB
6Wrong answer0/23ms2584 KiB
7Wrong answer0/23ms2724 KiB
8Wrong answer0/23ms2852 KiB
9Accepted2/23ms2956 KiB
10Accepted2/23ms2932 KiB
11Wrong answer0/23ms3472 KiB
12Wrong answer0/23ms4432 KiB
13Wrong answer0/37ms4504 KiB
14Wrong answer0/38ms5976 KiB
15Wrong answer0/37ms6240 KiB
16Time limit exceeded0/3358ms3340 KiB
17Time limit exceeded0/3365ms3340 KiB
18Time limit exceeded0/3381ms3400 KiB
19Wrong answer0/312ms9548 KiB
20Wrong answer0/313ms11100 KiB
21Wrong answer0/382ms19008 KiB
22Accepted3/386ms18976 KiB