11784 | 2024-11-10 18:29:28 | Mittomen | Zsonglőrködés | cpp17 | Time limit exceeded 0/100 | 1.6s | 2948 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;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 1ms | 500 KiB | ||||
2 | Accepted | 1ms | 320 KiB | ||||
subtask2 | 0/20 | ||||||
3 | Accepted | 6ms | 320 KiB | ||||
4 | Time limit exceeded | 1.6s | 2856 KiB | ||||
5 | Time limit exceeded | 1.6s | 2832 KiB | ||||
6 | Time limit exceeded | 1.6s | 2824 KiB | ||||
7 | Time limit exceeded | 1.6s | 2844 KiB | ||||
8 | Time limit exceeded | 1.578s | 2792 KiB | ||||
9 | Time limit exceeded | 1.578s | 2940 KiB | ||||
10 | Time limit exceeded | 1.58s | 2948 KiB | ||||
11 | Time limit exceeded | 1.6s | 2848 KiB | ||||
subtask3 | 0/35 | ||||||
12 | Accepted | 1ms | 320 KiB | ||||
13 | Accepted | 1ms | 508 KiB | ||||
14 | Accepted | 1ms | 320 KiB | ||||
15 | Accepted | 2ms | 512 KiB | ||||
16 | Accepted | 2ms | 320 KiB | ||||
17 | Wrong answer | 2ms | 320 KiB | ||||
18 | Accepted | 2ms | 320 KiB | ||||
19 | Wrong answer | 2ms | 320 KiB | ||||
20 | Wrong answer | 2ms | 320 KiB | ||||
subtask4 | 0/45 | ||||||
21 | Accepted | 6ms | 512 KiB | ||||
22 | Time limit exceeded | 1.6s | 2028 KiB | ||||
23 | Time limit exceeded | 1.6s | 2840 KiB | ||||
24 | Time limit exceeded | 1.6s | 2804 KiB | ||||
25 | Time limit exceeded | 1.6s | 2800 KiB | ||||
26 | Time limit exceeded | 1.593s | 1980 KiB | ||||
27 | Time limit exceeded | 1.593s | 2760 KiB | ||||
28 | Time limit exceeded | 1.593s | 1972 KiB | ||||
29 | Time limit exceeded | 1.598s | 2800 KiB |