21382022-12-22 09:46:16BttrngÁruszállítás (75 pont)cpp11Accepted 75/7585ms11636 KiB
#include<bits/stdc++.h>
using namespace std;
vector<int>t;
int main(){
    int all, ar;
    cin>>all>>ar;
    t.resize(all+1);
    for(int i=1; i<=ar; i++){
        int a, b;
        cin>>a>>b;
        t[a]++;
        t[b]--;
    }
    for(int i=2; i<=all; i++){
        t[i]+=t[i-1];
        //cout<<t[i]<<" ";
    }
    int db=0;
    for(int i=1; i<=all-1; i++){
        if(t[i]==0){
                db++;
        }
    }
    cout<<db;

}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1748 KiB
2Accepted0/082ms9708 KiB
3Accepted3/32ms2284 KiB
4Accepted3/32ms2520 KiB
5Accepted3/32ms2688 KiB
6Accepted3/32ms2680 KiB
7Accepted3/32ms2728 KiB
8Accepted4/42ms2804 KiB
9Accepted4/42ms2800 KiB
10Accepted4/42ms2928 KiB
11Accepted4/43ms3444 KiB
12Accepted4/43ms4092 KiB
13Accepted4/46ms3992 KiB
14Accepted4/48ms5016 KiB
15Accepted4/46ms4840 KiB
16Accepted4/48ms5880 KiB
17Accepted4/49ms6808 KiB
18Accepted4/410ms7456 KiB
19Accepted4/49ms6688 KiB
20Accepted4/410ms7456 KiB
21Accepted4/471ms11372 KiB
22Accepted4/485ms11636 KiB