| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1357863 | maya_s | 가장 긴 여행 (IOI23_longesttrip) | C++20 | 3 ms | 412 KiB |
#include "longesttrip.h"
#include<bits/stdc++.h>
using namespace std;
typedef int ll;
vector<int> longest_trip(int n, int d)
{
vector<ll> ans;
queue<ll> q;
for(ll i = 1; i < n; i++) q.push(i);
ll node = 0;
deque<ll> dq; dq.push_back(0);
while(q.size()){
ll x = q.front(); q.pop();
if(are_connected({node}, {x})) {
dq.push_back(x); node = x;
}
else if(q.size()){
ll y = q.front(); q.pop();
dq.push_back(y); dq.push_back(x); node = x;
}
else dq.push_front(x);
}
while(dq.size()) ans.push_back(dq.front()), dq.pop_front();
return ans;
}
| # | 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... | ||||
