Submission #876338

#TimeUsernameProblemLanguageResultExecution timeMemory
876338AndreyPrisoner Challenge (IOI22_prison)C++17
38 / 100
15 ms1628 KiB
#include "prison.h" #include<bits/stdc++.h> using namespace std; std::vector<std::vector<int>> devise_strategy(int n) { vector<vector<int>> ans(0); for(int i = 0; i < 39; i++) { ans.push_back(vector<int> (n+1)); } for(int i = 0; i < 39; i++) { if(i%3 == 0) { ans[i][0] = 0; } else { ans[i][0] = 1; } int d = 12-(i/3); for(int j = 1; j <= n; j++) { if(i%3 == 0) { ans[i][j] = i+1; if((1 << d)&j) { ans[i][j]++; } } else { bool x = (j&(1 << d)),y = (i%3)-1; if(x == y) { ans[i][j] = min(38,i-(i%3)+3); } else if(x < y) { ans[i][j] = -2; } else { ans[i][j] = -1; } } } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...