Submission #846199

#TimeUsernameProblemLanguageResultExecution timeMemory
846199JoksimKaktusLongest Trip (IOI23_longesttrip)C++17
10 / 100
6 ms600 KiB
#include "longesttrip.h" #include <bits/stdc++.h> using namespace std; vector<int> longest_trip(int N, int D) { vector <int> v; if(D == 3){ for(int i = 0;i < N;i++){ v[i] = i; } }else{ int last; if(are_connected({0},{1})){ v.push_back(0); v.push_back(1); if(are_connected({0},{2})){ v.insert(v.begin(),2); last = 1; }else{ v.push_back(2); last = 2; } }else{ v.push_back(0); v.push_back(2); v.push_back(1); last = 1; } for(int i = 3; i < N;i++){ if(are_connected({last},{i})){ v.push_back(i); last = i; }else{ v.insert(v.begin(),i); } } } return v; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...