이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "prison.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#include "/home/eagle/ioi22/debug.h"
#else
#define debug(...) void(37)
#endif
std::vector<std::vector<int>> devise_strategy(int N) {
int M = 24;
const int BIT = 12;
vector<vector<int>> S(M + 1, vector<int>(N + 1));
S[0][0] = 0;
for (int i = 1; i <= N; ++i) {
S[0][i] = 1 + (i >= (1 << BIT));
}
debug(S[0]);
for (int i = 1; i <= M; ++i) {
int bit = (1 + BIT - (i + 1) / 2);
S[i][0] = 1 ^ (bit % 2);
bool val = (i + 1) % 2;
debug(i, bit, val);
for (int j = 1; j <= N; ++j) {
int my_val = (j >> bit) & 1;
if (my_val != val) {
S[i][j] = ((S[i][0] ^ (my_val < val)) ? -1 : -2);
continue;
}
if (bit == 1) {
S[i][j] = (((j % 2 == 0) ^ S[i][0]) ? -1 : -2);
continue;
}
S[i][j] = 3 + 2 * (BIT - bit) + ((j >> (bit - 1)) % 2);
}
//debug(S[i]);
}
return S;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |