117842024-11-10 18:29:28MittomenZsonglőrködéscpp17Time limit exceeded 0/1001.6s2948 KiB
#include <iostream>
#include <cstdint>
#include <vector>

using namespace std;

int main() {
	int n;
	vector<vector<int>> days;


	cin >> n;

	int start, end;
	for (int i = 0; i < n; i++) {
		cin >> start >> end;

		bool found_day = false;
		for (int j = 0; j < days.size(); j++) {
			vector<int>& day = days[j];

			if (end == day[0]) {
				day[0] = start;
				found_day = true;
				break;
			}
			else if (start == day[1]) {
				day[1] = end;
				found_day = true;
				break;
			}

		}

		if (!found_day) {
			days.push_back({start, end});
		}
	}

	cout << days.size();

	return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms500 KiB
2Accepted1ms320 KiB
subtask20/20
3Accepted6ms320 KiB
4Time limit exceeded1.6s2856 KiB
5Time limit exceeded1.6s2832 KiB
6Time limit exceeded1.6s2824 KiB
7Time limit exceeded1.6s2844 KiB
8Time limit exceeded1.578s2792 KiB
9Time limit exceeded1.578s2940 KiB
10Time limit exceeded1.58s2948 KiB
11Time limit exceeded1.6s2848 KiB
subtask30/35
12Accepted1ms320 KiB
13Accepted1ms508 KiB
14Accepted1ms320 KiB
15Accepted2ms512 KiB
16Accepted2ms320 KiB
17Wrong answer2ms320 KiB
18Accepted2ms320 KiB
19Wrong answer2ms320 KiB
20Wrong answer2ms320 KiB
subtask40/45
21Accepted6ms512 KiB
22Time limit exceeded1.6s2028 KiB
23Time limit exceeded1.6s2840 KiB
24Time limit exceeded1.6s2804 KiB
25Time limit exceeded1.6s2800 KiB
26Time limit exceeded1.593s1980 KiB
27Time limit exceeded1.593s2760 KiB
28Time limit exceeded1.593s1972 KiB
29Time limit exceeded1.598s2800 KiB