Submission #842487

#TimeUsernameProblemLanguageResultExecution timeMemory
842487CodePlatinaLongest Trip (IOI23_longesttrip)C++17
15 / 100
781 ms596 KiB
#include "longesttrip.h" #include <iostream> #include <algorithm> #define pii pair<int, int> #define ff first #define ss second using namespace std; vector<int> longest_trip(int N, int d) { bool chc[N]{}; vector<pii> V; for(int i = 0; i < N; ++i) { for(int j = i + 1; j < N; ++j) { if(!are_connected(vector<int>{i}, vector<int>{j})) chc[i] = true, chc[j] = true, V.push_back({i, j}); } } vector<int> ret; for(auto [x, y] : V) ret.push_back(x); for(int i = 0; i < N; ++i) if(!chc[i]) ret.push_back(i); for(auto [x, y] : V) ret.push_back(y); return ret; }
#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...