113182024-08-08 13:38:32bzyÁruszállítás (75 pont)cpp17Time limit exceeded 63/75391ms4324 KiB
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,m;
	cin >> n >> m;
	int A[n+1] = {0};
	int o = n-1;
	for(int i = 0; i<m;i++){
		int start; int end;
		cin >> start >> end;
		for(int j = start; j<end; j++){
			if(A[j] == 0)o--; 
			A[j]++;
		}
	}
	cout<<o;
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base63/75
1Accepted0/03ms380 KiB
2Accepted0/096ms4240 KiB
3Accepted3/33ms404 KiB
4Accepted3/33ms424 KiB
5Accepted3/33ms420 KiB
6Accepted3/33ms376 KiB
7Accepted3/32ms360 KiB
8Accepted4/42ms376 KiB
9Accepted4/42ms356 KiB
10Accepted4/42ms376 KiB
11Accepted4/43ms760 KiB
12Accepted4/43ms632 KiB
13Accepted4/47ms740 KiB
14Accepted4/48ms1124 KiB
15Accepted4/47ms1140 KiB
16Time limit exceeded0/4391ms1552 KiB
17Time limit exceeded0/4391ms1900 KiB
18Time limit exceeded0/4386ms2420 KiB
19Accepted4/410ms1892 KiB
20Accepted4/412ms2412 KiB
21Accepted4/489ms4324 KiB
22Accepted4/490ms4324 KiB