Submission #839730

#TimeUsernameProblemLanguageResultExecution timeMemory
839730model_codeLongest Trip (IOI23_longesttrip)C++17
0 / 100
983 ms260 KiB
// incorrect/sol_birka0_pv_D1Half_rand.cpp #include "longesttrip.h" #include <algorithm> #include <random> using namespace std; random_device rd; mt19937 g(rd()); vector<int> longest_trip(int N, int /*D*/) { vector<int> t; for (int i = 0; i < N; ++i) { t.push_back(i); } bool ok = false; while (!ok) { shuffle(t.begin(), t.end(), g); ok = true; for (int i = 0; i + 1 < (N + 1) / 2; ++i) { if (!are_connected({t[i]}, {t[i + 1]})) { ok = false; break; } } } return vector<int>(t.begin(), t.begin() + (N + 1) / 2); }
#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...