제출 #825555

#제출 시각아이디문제언어결과실행 시간메모리
825555Username4132죄수들의 도전 (IOI22_prison)C++17
56 / 100
11 ms1132 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=27; 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...