Submission #626704

#TimeUsernameProblemLanguageResultExecution timeMemory
626704Minindu2006Prisoner Challenge (IOI22_prison)C++17
0 / 100
0 ms212 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; std::vector<std::vector<int>> devise_strategy(int N) { vector<vector<int>>ans(25,vector<int>(N + 1)); for (int i = 0;i<25;++i){ if (i == 0){ ans[i][0] = 0; for (int j = 1;j<=N;++j){ ans[i][j] = 12; } } else { if (i > 12){ ans[i][0] = 1; } else ans[i][0] = 0; for (int j = 1;j<=N;++j){ if (i > 12){ if (j & (1<<(25 - i))){ if (25 - i == 1){ if (j & 1){ ans[i][j] = -1; } else ans[i][j] = -2; } else{ ans[i][j] = (25 - i) - 1; } } else{ ans[i][j] = -2; } } else{ if (j & (1<<i)){ ans[i][j] = 25 - i; } else{ if (i == 1){ if (j & 1)ans[i][j] = -2; else ans[i][j] = -1; } else ans[i][j] = i - 1; } } } } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...