Submission #825554

#TimeUsernameProblemLanguageResultExecution timeMemory
825554Username4132Prisoner Challenge (IOI22_prison)C++17
0 / 100
1 ms212 KiB
#include "prison.h" #include <iostream> #include <vector> using namespace std; #define forn(i, n) for(int i=0; i<(int)n; ++i) #define forsn(i, s, n) for(int i=s; i<(int)n; ++i) const int Q=26; vector<vector<int>> devise_strategy(int n) { vector<vector<int>> ret(Q, vector<int>(n+1)); forn(i, Q) ret[i][0]=((i+1)>>1)&1; forn(i, Q) forsn(j, 1, n+1){ int ex = (i+1)>>1; int cas = (i&1); if((!!(j&(1<<(13 - ex)))) ^ cas){ ret[i][j]=(cas^(ex&1))? -1 : -2; } else{ ret[i][j] = min(2*(ex+1) - !!(j&(1<<(13 - ex - 1))), Q-1); } } return ret; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...