# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
841750 | Lyestria | 가장 긴 여행 (IOI23_longesttrip) | C++17 | 16 ms | 1368 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "longesttrip.h"
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
mt19937_64 rnd(time(0));
using vi = vector<int>;
vi mrg(const vi&a, const vi&b) {
vi c = a;
for(int x : b) c.push_back(x);
return c;
}
vector<int> longest_trip(int n, int d)
{
deque<vi> pths;
auto add_back =[&](const vi&v) {
if(v.size()==1)pths.push_back(v);
else pths.push_front(v);
};
for(int i=0;i<n;i++)add_back({i});
shuffle(pths.begin(),pths.end(), rnd);
while(pths.size()>2){
auto v1 = pths.back();
pths.pop_back();
auto v2 = pths.back();
pths.pop_back();
if(are_connected({v1[0]}, {v2[0]})) {
# | 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... |