Submission #839732

#TimeUsernameProblemLanguageResultExecution timeMemory
839732model_codeLongest Trip (IOI23_longesttrip)C++17
30 / 100
290 ms336 KiB
// incorrect/sol_birka0_D1Half_bigQ.cpp #include "longesttrip.h" #include <set> #include <algorithm> using namespace std; vector<int> longest_trip(int N, int /*D*/) { vector<int> t = {0}; set<int> s; for (int i = 1; i < N; ++i) { s.insert(i); } for (int l = 1; l < N; ++l) { bool succ = false; for (int x : s) { if (are_connected({t.back()}, {x})) { t.push_back(x); s.erase(x); succ = true; break; } } if (!succ) { break; } } if (s.size() > t.size()) { return vector<int>(s.begin(), s.end()); } return t; }
#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...