#include "longesttrip.h"
#include <bits/stdc++.h>
using namespace std;
// Subtask 1: D == 3
vector<int> sub1(int n) {
vector<int> res(n);
std::iota(res.begin(), res.end(), 0);
return res;
}
// Subtask 2: D == 2
vector<int> sub2(int n) {
vector<int> res;
res.push_back(0);
res.push_back(1);
for (int i = 2; i < n; i++) {
if (are_connected({res.back()}, {i})) {
res.push_back(i);
} else {
res.insert(res.begin(), i);
}
}
return res;
}
vector<int> longest_trip(int n, int d) {
if (d == 3) return sub1(n);
if (d == 2) return sub2(n);
return {};
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
208 KB |
Output is correct |
2 |
Correct |
1 ms |
208 KB |
Output is correct |
3 |
Correct |
1 ms |
208 KB |
Output is correct |
4 |
Correct |
0 ms |
208 KB |
Output is correct |
5 |
Correct |
0 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
208 KB |
Output is correct |
2 |
Correct |
9 ms |
208 KB |
Output is correct |
3 |
Correct |
9 ms |
208 KB |
Output is correct |
4 |
Correct |
8 ms |
208 KB |
Output is correct |
5 |
Correct |
7 ms |
208 KB |
Output is correct |
6 |
Incorrect |
0 ms |
208 KB |
Incorrect |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |