# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
841327 | I_love_Hoang_Yen | Longest Trip (IOI23_longesttrip) | C++17 | 16 ms | 436 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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
bool has_edge(int u, int v) {
return are_connected({u}, {v});
}
vector<int> sub2(int n) {
vector<int> res {0};
for (int i = 1; i < n; i++) {
if (has_edge(0, i)) {
res.push_back(i);
break;
}
}
for (int i = 1; i < n; i++) {
if (i == res[1]) continue;
if (has_edge(res.back(), i)) {
res.push_back(i);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |