113172024-08-08 13:27:56bzyÁruszállítás (75 pont)cpp17Time limit exceeded 63/75398ms5648 KiB
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,m;
	cin >> n >> m;
	int A[n+1] = {0};
	for(int i = 0; i<m;i++){
		int start; int end;
		cin >> start >> end;
		for(int j = start; j<end; j++){
			A[j]++;
		}
	}
	int c = 0;
	for(int i = 1;i<n;i++) if(A[i] == 0) c++;
	cout<<c;
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base63/75
1Accepted0/03ms356 KiB
2Accepted0/089ms5648 KiB
3Accepted3/33ms416 KiB
4Accepted3/33ms420 KiB
5Accepted3/33ms384 KiB
6Accepted3/33ms508 KiB
7Accepted3/33ms356 KiB
8Accepted4/43ms504 KiB
9Accepted4/42ms504 KiB
10Accepted4/43ms356 KiB
11Accepted4/43ms500 KiB
12Accepted4/43ms632 KiB
13Accepted4/47ms1016 KiB
14Accepted4/48ms1256 KiB
15Accepted4/47ms1144 KiB
16Time limit exceeded0/4393ms1640 KiB
17Time limit exceeded0/4393ms1960 KiB
18Time limit exceeded0/4398ms2412 KiB
19Accepted4/410ms2020 KiB
20Accepted4/412ms2404 KiB
21Accepted4/479ms5476 KiB
22Accepted4/479ms5604 KiB