| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1327734 | SpyrosAliv | 가장 긴 여행 (IOI23_longesttrip) | C++20 | 4 ms | 400 KiB |
#include "longesttrip.h"
#include <bits/stdc++.h>
using namespace std;
int n;
std::vector<int> longest_trip(int N, int D)
{
n = N;
assert(D >= 2);
vector<int> path;
path.push_back(0);
int curr = 2;
if (are_connected({0}, {1})) {
path.push_back(1);
curr = 2;
}
else {
path.push_back(2);
path.push_back(1);
curr = 3;
}
for (int i = curr; i < n; i++) {
if (are_connected({path.back()}, {i})) {
path.push_back(i);
}
else {
reverse(path.begin(), path.end());
path.push_back(i);
reverse(path.begin(), path.end());
}
}
return path;
}
| # | 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... | ||||
