This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "prison.h"
#include <bits/stdc++.h>
using namespace std;
using idata = vector<int>;
using igrid = vector<idata>;
idata test_case (int height, int N) {
idata result (N + 1);
int watch = (max(height, 1) - 1) >> 1;
int bytec = 12 - watch;
int chesc = ((height + 1) >> 1) & 1;
int byten = 12 - (watch + 1);
result[0] = chesc;
if (height == 0) {
for (int u = 1; u <= N; u ++) {
if ((1 << bytec) & u) result[u] = 2;
else result[u] = 1;
}
return result;
}
int bytecOther = (height - 1) & 1;
for (int u = 1; u <= N; u ++) {
int bytecCurr = ((1 << bytec) & u) >> bytec;
if (bytecCurr == bytecOther && byten != -1) {
int bytecNext = ((1 << byten) & u) >> byten;
result[u] = (height - bytecOther + 2 + bytecNext);
} else if (bytecCurr == 0) {
result[u] = -1 - chesc;
} else {
result[u] = -2 + chesc;
}
}
return result;
}
igrid devise_strategy(int N) {
igrid answer(27);
for (int i = 0; i < 27; i ++)
answer[i] = test_case(i, N);
return answer;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |