256152026-02-23 16:59:05GeneratrollTelefonközpont (40 pont)cpp17Accepted 40/4028ms1928 KiB
#include <bits/stdc++.h>
using namespace std;
int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int n;
	cin >> n;
	vector<int> v(400005, 0);
	for (int i = 0; i < n; i++) {
		int a;
		int b;
		cin >> a >> b;
		v[a]++;
		v[b + 1]--;
	}
	int m = 0;
	int c = 0;
	for (int x : v) {
		c += x;
		if (c > m) {
			m = c;
		}
	}
	cout << m << '\n';
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms1844 KiB
2Accepted0/028ms1844 KiB
3Accepted2/23ms1844 KiB
4Accepted2/23ms1844 KiB
5Accepted2/23ms1844 KiB
6Accepted2/26ms1844 KiB
7Accepted2/214ms1844 KiB
8Accepted3/314ms1844 KiB
9Accepted3/317ms1912 KiB
10Accepted3/323ms1844 KiB
11Accepted3/326ms1844 KiB
12Accepted3/314ms1848 KiB
13Accepted3/326ms1844 KiB
14Accepted3/314ms1844 KiB
15Accepted3/316ms1928 KiB
16Accepted3/323ms1844 KiB
17Accepted3/324ms1844 KiB