Submission #519945

#TimeUsernameProblemLanguageResultExecution timeMemory
519945sliviuCluedo (IOI10_cluedo)C++17
0 / 100
1 ms200 KiB
#include <bits/stdc++.h> #include "grader.h" #include "cluedo.h" using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int rand(int x, int y) { return uniform_int_distribution<int>(x, y)(rng); }; void Solve() { vector<vector<int>> pos = { {1,2,3,4,5,6},{1,2,3,4,5,6,7,8,9, 10}, {1,2,3,4,5,6} }; for (int i = 0;i < 3;++i) shuffle(pos[i].begin(), pos[i].end(), rng); for (int i = 1;i <= 3;++i) while (pos[i - 1].size() > 1) { int e1 = pos[0][rand(0, (int)pos[0].size() - 1)], e2 = pos[1][rand(0, (int)pos[1].size() - 1)], e3 = pos[2][rand(0, (int)pos[2].size() - 1)]; int r = Theory(e1, e2, e3); if (!r) return; if (r == 1) pos[0].erase(find(pos[0].begin(), pos[0].end(), e1)); else if (r == 2) pos[1].erase(find(pos[1].begin(), pos[1].end(), e2)); else pos[2].erase(find(pos[2].begin(), pos[2].end(), e3)); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...