9162022-01-27 19:11:09tomi7Áruszállítás (75 pont)cpp11Wrong answer 7/75111ms16084 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 vegigmenes=0;
   int valasz=0;
   bool b=false;
   vector<int> c(n);
   for(int i=0;i<m;i++){
       c[a[i].first-1]++;
       c[a[i].second-1]--;
   }
   //for(int i=0;i<n;i++){
    //   cerr<<c[i]<<' ';
  // }
   for(int i=0;i<n;i++){
       if(i==0){
          vegigmenes+=c[i];
          if(vegigmenes==0){
              valasz++;
          }
       }else{
          if(vegigmenes==0){
             valasz++;
          }
          vegigmenes+=c[i];
       }
   }
   cout<<valasz<<'\n';
}
SubtaskSumTestVerdictTimeMemory
base7/75
1Accepted0/02ms1740 KiB
2Wrong answer0/0111ms12500 KiB
3Wrong answer0/31ms3292 KiB
4Accepted3/31ms3296 KiB
5Wrong answer0/31ms3296 KiB
6Wrong answer0/31ms3304 KiB
7Wrong answer0/31ms3312 KiB
8Wrong answer0/41ms3312 KiB
9Wrong answer0/41ms3316 KiB
10Wrong answer0/41ms3324 KiB
11Wrong answer0/42ms3536 KiB
12Wrong answer0/42ms3928 KiB
13Wrong answer0/44ms4064 KiB
14Wrong answer0/48ms4788 KiB
15Wrong answer0/44ms4900 KiB
16Accepted4/47ms6004 KiB
17Wrong answer0/410ms6760 KiB
18Wrong answer0/413ms7780 KiB
19Wrong answer0/48ms6992 KiB
20Wrong answer0/49ms8148 KiB
21Wrong answer0/465ms14644 KiB
22Wrong answer0/468ms16084 KiB