제출 #775821

#제출 시각아이디문제언어결과실행 시간메모리
775821SanguineChameleon죄수들의 도전 (IOI22_prison)C++17
0 / 100
1 ms212 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; vector<vector<int>> devise_strategy(int N) { vector<vector<int>> res(25, vector<int>(N + 1, 0)); res[0][0] = 0; for (int k = 1; k <= N; k++) { res[0][k] = ((k >> 12) & 1) + 1; } for (int i = 12; i >= 1; i--) { int off = (12 - i) * 2 + 1; for (int j = 0; j < 2; j++) { res[off + j][0] = (i & 1) ^ 1; for (int k = 1; k <= N; k++) { if (((k >> i) & 1) ^ j) { res[off + j][k] = -1 - ((i & 1) ^ j); } else { if (i > 1) { res[off + j][k] = off + 2 + ((k >> (i - 1)) & 1); } else { res[off + j][k] = -1 - ((i & 1) ^ ((k >> (i - 1)) & 1)); } } } } } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...