Submission #839729

#TimeUsernameProblemLanguageResultExecution timeMemory
839729model_codeLongest Trip (IOI23_longesttrip)C++17
15 / 100
10 ms336 KiB
// correct/sol_birka0_st2.cpp #include "longesttrip.h" using namespace std; vector<int> longest_trip(int N, int /*D*/) { vector<int> t = {0}; int mx = N - 1; for (int i = 0; i + 1 <= mx; ++i) { if (!are_connected({i}, {i + 1})) { if (i + 1 < mx) { t.push_back(mx); --mx; } else { t.push_back(0); t.erase(t.begin()); } } t.push_back(i + 1); } 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...