61032023-10-29 22:30:45xxxZsonglőrködéscpp14Accepted 100/100226ms10720 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long 


signed main() {
	int n;
	cin >> n;
	vector<int> a(n), b(n);

	for (int i = 0; i < n; i++) {
		cin >> a[i] >> b[i];
	}

	sort(a.begin(), a.end());
	sort(b.begin(), b.end());

	int l = 0, r = 0, ans = 0;
	while(l < n && r < n) {
		if (a[l] < b[r]) {
			l++;
		} else if (a[l] > b[r]) {
			r++;
		} else if (a[l] == b[r]) {
			l++, r++, ans++;
		}
	}

	cout << n-ans << "\n";
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1684 KiB
2Accepted3ms1928 KiB
subtask220/20
3Accepted4ms2204 KiB
4Accepted68ms4260 KiB
5Accepted168ms7160 KiB
6Accepted202ms8312 KiB
7Accepted224ms9160 KiB
8Accepted224ms9200 KiB
9Accepted226ms9204 KiB
10Accepted224ms9332 KiB
11Accepted224ms9524 KiB
subtask335/35
12Accepted2ms3388 KiB
13Accepted3ms3384 KiB
14Accepted3ms3580 KiB
15Accepted3ms3576 KiB
16Accepted3ms3560 KiB
17Accepted3ms3560 KiB
18Accepted3ms3564 KiB
19Accepted3ms3684 KiB
20Accepted3ms3768 KiB
subtask445/45
21Accepted4ms4016 KiB
22Accepted61ms5812 KiB
23Accepted167ms8544 KiB
24Accepted175ms9712 KiB
25Accepted224ms10312 KiB
26Accepted197ms10512 KiB
27Accepted223ms10472 KiB
28Accepted194ms10512 KiB
29Accepted224ms10720 KiB