이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "prison.h"
#ifdef NYAOWO
#include "grader.cpp"
#endif
#include <bits/stdc++.h>
#define For(i, a, b) for(int i = a; i <= b; i++)
#define Forr(i, a, b) for(int i = a; i >= b; i--)
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define sz(x) ((int)x.size())
#define eb emplace_back
// #define int LL
using namespace std;
using i32 = int32_t;
using LL = long long;
using pii = pair<int, int>;
vector<vector<int>> devise_strategy(int N) {
int x = 12 * 3 + 2;
vector<vector<int>> res(x + 1);
For(i, 0, x) {
int k = i / 3;
int t = i % 3;
if(t == 0) res[i].eb(0);
else res[i].eb(1);
int b = 12 - k;
For(num, 1, N) {
int is1 = ((num & (1 << b)) != 0);
if(t == 0) {
res[i].eb(i + 1 + is1);
} else if(is1 != t - 1) {
if(is1) res[i].eb(-1);
else res[i].eb(-2);
} else {
if((k + 1) * 3 <= x) res[i].eb((k + 1) * 3);
else res[i].eb(-1);
}
}
}
return res;
}
/*
3
1 2
1 3
2 1
2 3
3 1
3 2
-1
A
A
B
A
B
B
*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |