이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "prison.h"
#include<bits/stdc++.h>
using namespace std;
#define in insert
#define all(x) x.begin(),x.end()
#define pb push_back
#define eb emplace_back
#define ff first
#define ss second
//#define int long long
typedef long long ll;
typedef vector<int> vi;
typedef set<int> si;
typedef multiset<int> msi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
vector<vector<int>> devise_strategy(int n) {
vector<vector<int>> ret(39, vector<int>(n + 1));
for(int i = 0; i < 39; i += 3) {
int bit = 12 - (i / 3);
ret[i][0] = 0;
ret[i + 1][0] = 1;
ret[i + 2][0] = 1;
for(int j = 1; j <= n; j++) {
int val = (j >> bit) & 1;
if(val) {
ret[i][j] = i + 2;
ret[i + 1][j] = -2;
ret[i + 2][j] = (i + 3 > 39 ? -1 : i + 3);
} else {
ret[i][j] = i + 1;
ret[i + 1][j] = (i + 3 > 39 ? -1 : i + 3);
ret[i + 2][j] = -1;
}
}
}
return ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |