71352023-12-31 12:10:54IgnácÁruszállítás (75 pont)cpp17Time limit exceeded 63/75400ms3872 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	std::ios::sync_with_stdio (false);
	cin.tie(0);
	cout.tie(0);
	int n, m;
	cin >> n >> m;
	vector<bool> ures(n, true);
	for (int i = 0; i < m; i++) {
		int a, b;
		cin >> a >> b;
		for (int j = a; j < b; j++) {
			ures[j] = false;
		}
	}
	
	int db = 0;
	for (int i = 1; i < n; i++) {
		if (ures[i]) db++;
	}

	cout << db;
}
SubtaskSumTestVerdictTimeMemory
base63/75
1Accepted0/03ms1832 KiB
2Accepted0/056ms2312 KiB
3Accepted3/33ms2292 KiB
4Accepted3/33ms2484 KiB
5Accepted3/32ms2528 KiB
6Accepted3/32ms2528 KiB
7Accepted3/32ms2528 KiB
8Accepted4/43ms2660 KiB
9Accepted4/43ms2868 KiB
10Accepted4/43ms2980 KiB
11Accepted4/43ms3060 KiB
12Accepted4/43ms3076 KiB
13Accepted4/44ms3220 KiB
14Accepted4/44ms3188 KiB
15Accepted4/44ms3188 KiB
16Time limit exceeded0/4400ms3180 KiB
17Time limit exceeded0/4361ms2512 KiB
18Time limit exceeded0/4368ms3428 KiB
19Accepted4/48ms3576 KiB
20Accepted4/48ms3536 KiB
21Accepted4/448ms3760 KiB
22Accepted4/452ms3872 KiB