Submission #1078609

#TimeUsernameProblemLanguageResultExecution timeMemory
1078609ArthuroWichPrisoner Challenge (IOI22_prison)C++17
0 / 100
4 ms604 KiB
#include "prison.h" #include<bits/stdc++.h> using namespace std; vector<vector<int>> devise_strategy(int n) { vector<vector<int>> s(21, vector<int>(n+1, 0)); s[0][0] = 0; for (int i = 1; i <= n; i++) { int lastbit = 0; for (int j = 9; j >= 0; j--) { if (i & (1 << j)) { lastbit = j; break; } } s[0][i] = lastbit+1; } for (int j = 1; j <= 10; j++) { s[j][0] = 1; for (int i = 1; i <= n; i++) { if (i <= (1<<(j-1))) { s[j][i] = -2; } else if ((1<<j) <= i) { s[j][i] = -1; } else { s[j][i] = j+9; } } } for (int j = 11; j <= 20; j++) { s[j][0] = 0; for (int i = 1; i <= n; i++) { int lastbit = 0; for (int k = j-11; k >= 0; k--) { if (k & (1<<i)) { lastbit = k; break; } } s[j][i] = lastbit+1; } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...