Submission #1011635

#TimeUsernameProblemLanguageResultExecution timeMemory
1011635bachhoangxuanPrisoner Challenge (IOI22_prison)C++17
56 / 100
9 ms1116 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...