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>
#include <vector>
#define ll long long
#define ull unsigned ll
#define f first
#define s second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define epb emplace_back
using namespace std;
std::vector<std::vector<int>> devise_strategy(int N) {
vector <vector <int> > s;
s.resize(25);
s[0].resize(N + 1);
s[0][0] = 0;
for(int j = 1; j <= N; j++){
if(j & (1 << 12)) s[0][j] = 24;
else s[0][j] = 23;
}
for(int j = 1; j <= 24; j++){
s[j].resize(N + 1);
int o = ((j + 1) / 2) % 2;
s[j][0] = o ^ 1;
int lst = (j + 1) / 2;
int ind = (j + 1) % 2;
for(int i = 1; i <= N; i++){
int nind;
if(i & (1 << lst)) nind = 1;
else nind = 0;
if(nind > ind){
s[j][i] = -(1 ^ s[j][0]) - 1;
}
if(nind < ind)
s[j][i] = -(s[j][0]) - 1;
if(nind == ind){
if(lst == 1){
if(i % 2) s[j][i] = -(1 ^ s[j][0]) - 1;
else s[j][i] = -(s[j][0]) - 1;
}
else{
int v = lst - 1;
if(i & (1 << v)) s[j][i] = 2 * v;
else s[j][i] = 2 * v - 1;
}
}
}
}
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... |