Submission #854852

#TimeUsernameProblemLanguageResultExecution timeMemory
854852TrytytkaPrisoner Challenge (IOI22_prison)C++17
36.50 / 100
16 ms1628 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...