80282024-01-12 10:52:29ChickenÁruszállítás (75 pont)cpp17Accepted 75/75115ms8004 KiB
#include <iostream>

using namespace std;

int main() {
    int n, m;
    cin>>n>>m;
    int nan[m];
    int va[m];
    int ossz=0;
    bool joe[n];
    for(int i=0; i<n; i++) {
        joe[i]=1;
    }
    for(int i=0; i<m; i++) {
        cin>>nan[i]>>va[i];
        for(int j=nan[i]; j<va[i]; j++) {
            joe[j]=0;
        }
    }
    for(int i=0; i<n; i++) {
        if(joe[i]==1) {
            ossz++;
        }
    }
    cout<<ossz-1;
return 0; }
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1880 KiB
2Accepted0/075ms5660 KiB
3Accepted3/33ms2280 KiB
4Accepted3/32ms2360 KiB
5Accepted3/33ms2492 KiB
6Accepted3/33ms2704 KiB
7Accepted3/33ms2948 KiB
8Accepted4/43ms3032 KiB
9Accepted4/43ms3128 KiB
10Accepted4/43ms3212 KiB
11Accepted4/43ms3524 KiB
12Accepted4/43ms3768 KiB
13Accepted4/47ms4024 KiB
14Accepted4/48ms4468 KiB
15Accepted4/46ms4552 KiB
16Accepted4/461ms4928 KiB
17Accepted4/479ms5172 KiB
18Accepted4/4115ms5660 KiB
19Accepted4/48ms5320 KiB
20Accepted4/49ms5604 KiB
21Accepted4/468ms7876 KiB
22Accepted4/471ms8004 KiB