제출 #627333

#제출 시각아이디문제언어결과실행 시간메모리
627333PunnyBunny죄수들의 도전 (IOI22_prison)C++17
56 / 100
20 ms1108 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; std::vector<std::vector<int>> devise_strategy(int n) { vector<vector<int>> res(27, vector<int>(n + 1)); res[0][0] = 0; // bag A for (int j = 1; j <= n; ++j) res[0][j] = 1 + (j >> 12 & 1); for (int i = 1; i <= 13; ++i) { int bag = i & 1; // look bag BABA alternating for (int b = 0; b < 2; ++b) { int x = i * 2 - 1 + b; res[x][0] = bag; for (int j = 1; j <= n; ++j) { int c = j >> (13 - i) & 1; if (c < b) { if (bag == 0) { // looking A res[x][j] = -1; } else { res[x][j] = -2; } } else if (c > b) { if (bag == 0) { res[x][j] = -2; } else { res[x][j] = -1; } } else if (i != 13) { res[x][j] = i * 2 + 1 + (j >> (12 - i) & 1); } } } } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...