Submission #986526

#TimeUsernameProblemLanguageResultExecution timeMemory
986526Hugo1729Prisoner Challenge (IOI22_prison)C++17
38 / 100
15 ms1628 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; vector<vector<int>> devise_strategy(int N) { int x=3*13-1; vector<vector<int>> ans(x+1,vector<int>(N+1,0)); for(int i=0;i<=x;i++)ans[i][0]=((i%3)!=0); for(int i=0;i<x-1;i++){ for(int j=1;j<N+1;j++){ int p = i/3; int b = 12-p; if(i%3==0){ if(j&(1<<b))ans[i][j]=i+1; else ans[i][j]=i+2; }else if(i%3==1){ if(j&(1<<b))ans[i][j]=i+2; else ans[i][j]=-2; }else{ if(j&(1<<b))ans[i][j]=-1; else ans[i][j]=i+1; } } } for(int j=1;j<N+1;j++){ if(j&1)ans[x-1][j]=0; else ans[x-1][j]=-2; if(j&1)ans[x][j]=-1; else ans[x][j]=0; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...