#include "longesttrip.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> longest_trip(int n, int d){
deque <int> q;
q.push_back(0);
if(are_connected({0}, {1})) q.push_back(1);
else {
q.push_back(2);
q.push_back(1);
}
for(int i = q.size(); i < n; i++){
if(are_connected({i}, {q.back()})) q.push_back(i);
else q.push_front(i);
}
vector <int> v;
while(!q.empty()){
int x = q.back();
q.pop_back();
v.push_back(x);
}
return v;
}
# | 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... |