이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "prison.h"
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
vector<vector<int>> devise_strategy(int n) {
int x = 27;
vector<vector<int>> a(x + 1, vector<int>(n + 1, 0));
a[0][0] = 0;
for(int i = 1; i <= n; ++i) {
if(i >> 12 & 1) {
a[0][i] = 27;
} else a[0][i] = 26;
}
for(int i = 27; i >= 2; --i) {
int bit = i / 2 - 1;
if(bit % 2 == 0) {
//did a now looking at b;
a[i][0] = 1;
for(int j = 1; j <= n; ++j) {
if(j >> bit & 1) {
if(i % 2 == 0) {
a[i][j] = -1;
} else {
a[i][j] = (bit - 1) * 2 + (j >> (bit - 1) & 1) + 2;
}
} else {
if(i % 2 == 1) {
a[i][j] = -2;
} else {
a[i][j] = (bit - 1) * 2 + (j >> (bit - 1) & 1) + 2;
}
}
}
} else {
//did b now looking at a
a[i][0] = 0;
for(int j = 1; j <= n; ++j) {
if(j >> bit & 1) {
if(i % 2 == 0) {
a[i][j] = -2;
} else {
a[i][j] = (bit - 1) * 2 + (j >> (bit - 1) & 1) + 2;
}
} else {
if(i % 2 == 1) {
a[i][j] = -1;
} else {
a[i][j] = (bit - 1) * 2 + (j >> (bit - 1) & 1) + 2;
}
}
}
}
}
return a;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |