Submission #728656

#TimeUsernameProblemLanguageResultExecution timeMemory
728656Elvin_FritlPrisoner Challenge (IOI22_prison)C++17
56 / 100
20 ms1116 KiB
#include <bits/stdc++.h> #include "prison.h" using namespace std; vector<vector<int>> devise_strategy(int N) { vector<vector<int>> v(27,vector<int>(N+1,0)); v[0][0]=0; for(int i=1;i<=N;i++){ int d[14]; int num=i; for(int z=13;z>=1;z--){ d[z]=num%2; num/=2; } v[0][i]=d[1]*13+1; } for(int i=1;i<=26;i++){ int h,h2; h=0; if(i>13){ h=1; } h2=i-h*13; v[i][0]=h2%2; for(int j=1;j<=N;j++){ int d[15]; int num=j; d[14] = 0; for(int z=13;z>=1;z--){ d[z]=num%2; num/=2; } if(h==d[h2]){ v[i][j]=h2+1+d[h2+1]*13; } else if(h>d[h2]){ v[i][j]=-h2%2-1; } else{ v[i][j]=h2%2-2; } } } return v; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...