| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1187729 | MatteoArcari | 가장 긴 여행 (IOI23_longesttrip) | C++20 | 3 ms | 408 KiB |
#include "longesttrip.h"
#include <bits/stdc++.h>
using namespace std;
bool are_connected(vector<int> A, vector<int> B);
vector<int> longest_trip(int n, int d) {
deque<int> path;
if (are_connected({0}, {1})) {
if (are_connected({1}, {2})) {
path = {0, 1, 2};
} else {
path = {2, 0, 1};
}
} else {
path = {1, 2, 0};
}
for (int i = 3; i < n; i++) {
if (are_connected({i}, {path.back()})) {
path.push_back(i);
} else {
path.push_front(i);
}
}
return vector<int>(path.begin(), path.end());
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
