8752022-01-22 14:11:51tomi7Áruszállítás (75 pont)cpp11Time limit exceeded 35/75398ms6704 KiB
#include <bits/stdc++.h>
using namespace std;

int main(){
   int n, m;
   cin>>n>>m;
   vector<pair<int, int>> a(m);
   for(int i=0;i<m;i++){
       cin>>a[i].first>>a[i].second;
   }
   int valasz=0;
   bool b=false;
   for(int i=2;i<=n;i++){
       for(int j=0;j<m;j++){
           if(i-1>=a[j].first &&i<=a[j].second){
               b=true;
               break;
           }
       }
       if(!b){
          valasz++;
       }
       b=false;
   }
   cout<<valasz<<'\n';
}
SubtaskSumTestVerdictTimeMemory
base35/75
1Accepted0/02ms1740 KiB
2Time limit exceeded0/0393ms3236 KiB
3Accepted3/31ms3292 KiB
4Accepted3/31ms3300 KiB
5Accepted3/31ms3196 KiB
6Accepted3/31ms3304 KiB
7Accepted3/31ms3308 KiB
8Accepted4/41ms3208 KiB
9Accepted4/41ms3312 KiB
10Accepted4/41ms3320 KiB
11Accepted4/44ms3324 KiB
12Accepted4/435ms3332 KiB
13Time limit exceeded0/4393ms2492 KiB
14Time limit exceeded0/4388ms2628 KiB
15Time limit exceeded0/4398ms2676 KiB
16Time limit exceeded0/4389ms2876 KiB
17Time limit exceeded0/4391ms2980 KiB
18Time limit exceeded0/4389ms3088 KiB
19Time limit exceeded0/4395ms3276 KiB
20Time limit exceeded0/4389ms3332 KiB
21Time limit exceeded0/4397ms5400 KiB
22Time limit exceeded0/4365ms6704 KiB