Submission #1073311

#TimeUsernameProblemLanguageResultExecution timeMemory
1073311fv3Prisoner Challenge (IOI22_prison)C++17
36.50 / 100
21 ms1628 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; vector<vector<int>> devise_strategy(int N) { vector<vector<int>> p(14 * 3 - 2, vector<int>(N+1, 1)); int bit = 14; for (int i = 0; i < 14 * 3 - 2; i++) { if (i % 3 == 0) { p[i][0] = 0; bit--; for (int j = 1; j <= N; j++) { if (j & (1 << bit)) p[i][j] = i + 2; else p[i][j] = i + 1; } } else if (i % 3 == 1) { for (int j = 1; j <= N; j++) { if (j & (1 << bit)) p[i][j] = -1; else p[i][j] = i + 2; } } else { for (int j = 1; j <= N; j++) { if (j & (1 << bit)) p[i][j] = i + 1; else p[i][j] = -2; } } } for (int i = 1; i <= N; i++) { if (p.back()[i] == 40) p.back()[i] = -1; else p.back()[i] = -2; } return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...