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 <cassert>
//#include <cstdio>
//
//#include <string>
//#include <vector>
using namespace std;
typedef int ll;
//const ll N=1e6+9;
ll a,b,c,d,a1,b1,c1,val,i,sum1,j,n,m,pos,ans,sum,cur,res,ans1,res1;
ll k,kk,kkk,cnt,cnt1,l,r,x,y,mn,t,fl,q,bit;
vector<vector<int>> devise_strategy(int N) {
vector<vector<ll>>v(27,vector<ll>(N+1));
v[0][0]=0;
for(ll i=1;i<=N;i++){
v[0][i]=13*(1+(i>>12&1));
}
for(ll i=1; i<=26; i++){
if(i<=13) bit=i-1,val=0;
else bit=i-14,val=1;
v[i][0]=(bit+1)&1;
for(ll j=1;j<=N;j++){
res=(j>>bit&1);
if(res==val){
v[i][j]=bit+13*(j>>(bit-1)&1);
}
else{
if(res==0 && val==1) v[i][j]=-(v[i][0]+1);
else{
if(v[i][0]==0) v[i][j]=-2;
else v[i][j]=-1;
}
}
}
}
return v;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |