Submission #920843

#TimeUsernameProblemLanguageResultExecution timeMemory
920843AkibAzmainPrisoner Challenge (IOI22_prison)C++17
10 / 100
5 ms604 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; std::vector<std::vector<int>> devise_strategy (int n) { vector < vector < int > > ans (22, vector < int > (n + 1)); for (int i = 0; i < 7; ++i) for (int j = 0; j < 3; ++j) { int k = i * 3 + j + 1; ans[k][0] = i % 2; for (int m = 1; m <= n; ++m) { int p = m; for (int q = 0; q < i; ++q) p /= 3; p %= 3; if (p < j) ans[k][m] = -1 - (i % 2); else if (p > j) ans[k][m] = -2 + (i % 2); else { p = m; for (int q = 0; q < i - 1; ++q) p /= 3; p %= 3; if (i == 0) p = 0; ans[k][m] = (i - 1) * 3 + p + 1; } } } for (int j = 0; j < 3; ++j) { int i = 7; int k = 0; ans[k][0] = i % 2; for (int m = 1; m <= n; ++m) ans[k][m] = (i - 1) * 3 + 1; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...