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<bits/stdc++.h>
#include "prison.h"
using namespace std;
vector<vector<int>> devise_strategy(int N) {
vector<vector<int>> s;
int pot = 1;
while(pot<5000) pot*=2;
pot/=2;
for(int i=0; i<=24; i++){
vector<int> v;
int t = (i+1)/2;
v.push_back(t%2);
int gorgias = pot;
for(int j=0; j<t; j++) gorgias/=2;
for(int j=1; j<=N; j++){
if((j&(2*gorgias))/(2*gorgias)==i%2){
if(i%2==0){
if(t%2==0) v.push_back(-1);
if(t%2==1) v.push_back(-2);
}else{
if(t%2==1) v.push_back(-1);
if(t%2==0) v.push_back(-2);
}
}else if(t==12){
if(j%2==0) v.push_back(-1);
if(j%2==1) v.push_back(-2);
}else{
int I = 2*t+1+((gorgias&j)/gorgias);
v.push_back(I);
}
}
s.push_back(v);
}
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... |