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;
const int X=27;
vector<vector<int>> devise_strategy(int N) {
vector<vector<int>> s(X,vector<int>(N+1,0));
s[0][0]=1;
for(int i=1;i<=N;i++) s[0][i]=24+(i>>12&1)+1;
for(int i=1;i<X;i++){
int t=(i-1)>>1,a=(i-1)&1;
s[i][0]=t&1;
for(int j=1;j<=N;j++){
int b=(j>>t)&1;
if(a>b) s[i][j]=-s[i][0]-1;
else if(a<b) s[i][j]=-(s[i][0]^1)-1;
else s[i][j]=2*(t-1)+(j>>(t-1)&1)+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... |