9372022-01-29 15:38:01HorakZsofiÁruszállítás (75 pont)cpp11Accepted 75/7579ms14568 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n,db;
  cin>>n>>db;
  int szaml=0;
  int megold=0;
  vector<int>allomasok(n+1);
  for(int i=0; i<db; i++){
    int x,y;
    cin>>x>>y;
    allomasok[x]++;
    allomasok[y]--;
  }
  for(int i=1; i<n; i++){
    szaml+=allomasok[i];
if(szaml==0){
megold++;
}
  }
  cout<<megold;
  return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/02ms1772 KiB
2Accepted0/079ms10988 KiB
3Accepted3/31ms3336 KiB
4Accepted3/31ms3336 KiB
5Accepted3/31ms3348 KiB
6Accepted3/31ms3344 KiB
7Accepted3/31ms3356 KiB
8Accepted4/41ms3356 KiB
9Accepted4/41ms3360 KiB
10Accepted4/41ms3360 KiB
11Accepted4/41ms3580 KiB
12Accepted4/42ms3972 KiB
13Accepted4/44ms3848 KiB
14Accepted4/47ms4832 KiB
15Accepted4/44ms4940 KiB
16Accepted4/47ms6044 KiB
17Accepted4/48ms6800 KiB
18Accepted4/49ms7820 KiB
19Accepted4/48ms7036 KiB
20Accepted4/49ms8068 KiB
21Accepted4/471ms13132 KiB
22Accepted4/478ms14568 KiB