Submission #805661

#TimeUsernameProblemLanguageResultExecution timeMemory
805661caganyanmazPrisoner Challenge (IOI22_prison)C++17
72 / 100
10 ms1100 KiB
#include <bits/stdc++.h> #include "prison.h" //#define DEBUGGING using namespace std; constexpr static int x = 23; void __print(int i) { cerr << i; } template<typename T> void __print(T& t) { cerr << "{"; int f = 0; for (auto& i : t) { cerr << (f++ ? ", " : ""); __print(i); } cerr << "}"; } void _print() { cerr << "]\n"; } template<typename T, typename... V> void _print(T t, V... v) { __print(t); if (sizeof...(v)) cerr << ", "; _print(v...); } #ifdef DEBUGGING #define debug(x...) { cerr << "[" << (#x) << "] = ["; _print(x); } #else #define debug(x...) #endif vector<vector<int>> devise_strategy(int n) { vector<vector<int>> res = vector<vector<int>>(x+1, vector<int>(n+1)); for (int i = x; i > 0; i--) { int bit = 1 + (i / 2); res[i][0] = (bit&1)^1; for (int j = 1; j <= n; j++) { if (((j>>bit)&1) == (i&1)) { if (bit > 2) res[i][j] = (bit-2) * 2 + ((j>>(bit-1))&1); else if ((j&3) == 3) res[i][j] = res[i][0] - 2; else if ((j&3) == 0) res[i][j] = - 1 - res[i][0]; else res[i][j] = 1; } else if ((j>>bit)&1) { res[i][j] = res[i][0] - 2; } else { res[i][j] = - 1 - res[i][0]; } } } res[0][0] = 0; for (int i = 1; i <= n; i++) res[0][i] = 22 + ((i>>12)&1); res[1][0] = 0; for (int i = 1; i <= n; i++) { int j = i&3; if (j > 1) res[1][i] = -2; else res[1][i] = -1; } debug(res); return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...