| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1172015 | woohyun_jng | Prisoner Challenge (IOI22_prison) | C++20 | 9 ms | 1348 KiB |
#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> devise_strategy(int N) {
vector<vector<int>> ans(42, vector<int>(N + 1, 0));
int X, Y, K;
for (int i = 0; i <= 41; i++) {
X = i == 0 ? 12 : i / 3 - 1, Y = i % 3;
ans[i][0] = i == 0 ? 0 : (Y == 2 ? 0 : 1);
for (int j = 1; j <= N; j++) {
K = (j & (1 << X)) >> X;
if (Y == 2)
ans[i][j] = (X + 1) * 3 + K;
else {
if (K < Y)
ans[i][j] = -2;
else if (K > Y)
ans[i][j] = -1;
else
ans[i][j] = X * 3 + 2;
}
}
}
return ans;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
