Submission #839932

#TimeUsernameProblemLanguageResultExecution timeMemory
839932pere_gilLongest Trip (IOI23_longesttrip)C++17
5 / 100
972 ms328 KiB
#include "longesttrip.h" #include "bits/stdc++.h" using namespace std; #define vi vector<int> #define ii pair<int,int> vi longest_trip(int n, int d){ int st=-1,en=-1; for(int i=0;i<n;i++) for(int j=i+1;j<n;j++) if(!are_connected({i},{j})) st=i,en=j; vi res; if(st!=-1) res.push_back(st); for(int i=0;i<n;i++) if(i!=st && i!=en) res.push_back(i); if(en!=-1) res.push_back(en); return res; }
#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...