61752023-11-05 13:39:48MCDaveZsonglőrködéscpp17Time limit exceeded 35/1001.6s5936 KiB
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	int n;
	cin >> n;

	vector<int> begin(n);
	vector<int> end(n);
	vector<int> minus(n, 0);

	for (int i = 0; i < n; i++)
	{
		int temp1 = 0, temp2 = 0;
		cin >> temp1 >> temp2;
		begin[i] = temp1;
		end[i] = temp2;
	}

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

	int days = 0, temp2 = 0;

	for (int i = 0; i < n; i++)
	{
		auto temp1 = find(end.begin(), end.end(), begin[i]);
		if (temp1 != end.end())
		{
			*temp1 = 0;
			begin[i] = 0;
		}
		else
		{
			days++;
		}
	}

	cout << days;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1748 KiB
2Accepted3ms1984 KiB
subtask20/20
3Accepted7ms2252 KiB
4Time limit exceeded1.6s2132 KiB
5Time limit exceeded1.57s3492 KiB
6Time limit exceeded1.554s4036 KiB
7Time limit exceeded1.562s4380 KiB
8Time limit exceeded1.554s4532 KiB
9Time limit exceeded1.574s4848 KiB
10Time limit exceeded1.557s5160 KiB
11Time limit exceeded1.557s5172 KiB
subtask335/35
12Accepted3ms3868 KiB
13Accepted3ms3992 KiB
14Accepted3ms3996 KiB
15Accepted3ms3892 KiB
16Accepted4ms4104 KiB
17Accepted4ms4216 KiB
18Accepted3ms4080 KiB
19Accepted4ms4080 KiB
20Accepted4ms4080 KiB
subtask40/45
21Accepted7ms4092 KiB
22Accepted1.485s5304 KiB
23Time limit exceeded1.574s5308 KiB
24Time limit exceeded1.582s5616 KiB
25Time limit exceeded1.57s5856 KiB
26Time limit exceeded1.549s5904 KiB
27Time limit exceeded1.557s5912 KiB
28Time limit exceeded1.549s5936 KiB
29Time limit exceeded1.565s5920 KiB