제출 #825554

#제출 시각아이디문제언어결과실행 시간메모리
825554Username4132죄수들의 도전 (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...