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>
using namespace std;
vector<vector<int>> devise_strategy(int N){
vector<vector<int>> s(40, vector<int>(N+1));
s[0][0]=0;
for (int i = 3; i-2 < 40; i++){
if(i%3==2) s[i-2][0]=0;
else s[i-2][0]=1;
}
for (int j = 1; j <= N; j++){
s[0][j]=1+((j&(1<<12))!=0);
}
for (int i = 3; i-2 < 40; i+=3){
for (int j = 1; j <= N; j++){
if(j&(1<<(12-(i/3-1)))) s[i-2][j]=-1;
else s[i-2][j]=i;
}
}
for (int i = 4; i-2 < 40; i+=3){
for (int j = 1; j <= N; j++){
if((j&(1<<(12-(i/3-1))))==0) s[i-2][j]=-2;
else s[i-2][j]=i-1;
}
}
for (int i = 5; i-2 < 40; i+=3){
for (int j = 1; j <= N; j++){
s[i-2][j]=min(39, i-1+((j&(1<<(12-(i/3))))!=0));
}
}
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... |