8992022-01-25 19:31:27tomi7Áruszállítás (75 pont)cpp11Wrong answer 7/7585ms16092 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/02ms1776 KiB
2Wrong answer0/085ms12500 KiB
3Wrong answer0/31ms3296 KiB
4Accepted3/31ms3304 KiB
5Wrong answer0/32ms3308 KiB
6Wrong answer0/31ms3308 KiB
7Wrong answer0/32ms3316 KiB
8Wrong answer0/41ms3320 KiB
9Wrong answer0/41ms3220 KiB
10Wrong answer0/41ms3332 KiB
11Wrong answer0/42ms3544 KiB
12Wrong answer0/43ms3940 KiB
13Wrong answer0/44ms4184 KiB
14Wrong answer0/417ms4916 KiB
15Wrong answer0/46ms4904 KiB
16Accepted4/410ms6016 KiB
17Wrong answer0/412ms6768 KiB
18Wrong answer0/49ms7788 KiB
19Wrong answer0/48ms6996 KiB
20Wrong answer0/48ms8160 KiB
21Wrong answer0/467ms14652 KiB
22Wrong answer0/467ms16092 KiB