# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
841733 | anhduc2701 | Longest Trip (IOI23_longesttrip) | C++17 | 5 ms | 600 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include "longesttrip.h"
#define pb push_back
#define fi first
#define se second
using namespace std;
typedef long long ll;
int n;
vector<int> longest_trip(int N,int D){
n=N;
if(D==3){
vector<int>K;
for(int i=0;i<N;i++){
K.pb(i);
}
return K;
}
else if(D==2){
vector<int>K;
if(are_connected(vector<int>(1,0),vector<int>(1,1))){
K.pb(0);
K.pb(1);
}
else{
K.pb(0);
K.pb(1);
K.pb(2);
}
for(int i=3;i<N;i++){
if(are_connected(vector<int>(1,K[0]),vector<int>(1,i))){
K.insert(K.begin(),i);
}
else{
K.pb(i);
}
}
return K;
}
}
Compilation message (stderr)
# | 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... |