Submission #1164444

#TimeUsernameProblemLanguageResultExecution timeMemory
1164444SmuggingSpunPrisoner Challenge (IOI22_prison)C++20
0 / 100
0 ms328 KiB
#include<bits/stdc++.h> #include "prison.h" using namespace std; template<class T>void minimize(T& a, T b){ if(a > b){ a = b; } } vector<vector<int>>devise_strategy(int n){ vector<vector<int>>s(27, vector<int>(n + 1)); s[0][0] = 0; auto get = [&] (int bit, bool parity){ return bit == -1 ? 26 : ((12 - bit) << 1) + int(parity) + 1; }; for(int i = 1; i <= n; i++){ s[0][i] = 1 + ((i >> 12) & 1); } for(int i = 1; i < 27; i++){ bool on = (i & 1) ^ 1; int bit = 12 - ((i - 1) >> 1); if(bit & 1){ s[i][0] = 0; for(int j = 1; j <= n; j++){ if(1 << bit & j){ s[i][j] = (on ? i + 2 : -2); } else{ s[i][j] = (on ? -1 : i + 2); } } } else{ s[i][0] = 1; for(int j = 1; j <= n; j++){ if(1 << bit & j){ s[i][j] = (on ? i + 2 : -1); } else{ s[i][j] = (on ? -2 : i + 2); } } } } for(int i = 0; i < 27; i++){ for(int j = 1; j <= n; j++){ minimize(s[i][j], 26); } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...