Submission #1022815

#TimeUsernameProblemLanguageResultExecution timeMemory
1022815vjudge1Prisoner Challenge (IOI22_prison)C++17
30 / 100
22 ms2140 KiB
#include "prison.h" #include<bits/stdc++.h> using namespace std; #define rall(s) s.rbegin(), s.rend() #define all(s) s.begin(), s.end() #define sz(s) (int)s.size() #define s second #define f first using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; const int N = 1e6; vector<vector<int>> devise_strategy(int n) { vector<vector<int>> ans; for (int x = 0; x <= 52; x++) { if (!x) { vector<int> s = {0}; for (int i = 1; i <= n; i++) { if (i >> 12 & 1) s.push_back(52); else s.push_back(50); } ans.push_back(s); continue; } int v = x - 1; if (v & 1) { vector<int> s = {1}; int b = v / 4, is = (v / 2) & 1; for (int i = 1; i <= n; i++) { if (i >> b & 1) { if (is && b) { s.push_back((b - 1) * 4 + 1); continue; } s.push_back(-1); }else { if (is || !b) { s.push_back(-2); continue; } s.push_back((b - 1) * 4 + 1); } } ans.push_back(s); }else { vector<int> s = {0}; int b = v / 4; for (int i = 1; i <= n; i++) { if (i >> b & 1) s.push_back(((b * 2) + 1) * 2 + 2); else s.push_back(b * 4 + 2); } ans.push_back(s); } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...