Submission #800561

#TimeUsernameProblemLanguageResultExecution timeMemory
800561Ronin13Prisoner Challenge (IOI22_prison)C++17
65 / 100
10 ms1064 KiB
#include "prison.h" #include <bits/stdc++.h> #include <vector> #define ll long long #define ull unsigned ll #define f first #define s second #define pii pair<int,int> #define pll pair<ll,ll> #define pb push_back #define epb emplace_back using namespace std; std::vector<std::vector<int>> devise_strategy(int N) { vector <vector <int> > s; s.resize(25); s[0].resize(N + 1); s[0][0] = 0; for(int j = 1; j <= N; j++){ if(j & (1 << 12)) s[0][j] = 24; else s[0][j] = 23; } for(int j = 1; j <= 24; j++){ s[j].resize(N + 1); int o = ((j + 1) / 2) % 2; s[j][0] = o ^ 1; int lst = (j + 1) / 2; int ind = (j + 1) % 2; for(int i = 1; i <= N; i++){ int nind; if(i & (1 << lst)) nind = 1; else nind = 0; if(nind > ind){ s[j][i] = -(1 ^ s[j][0]) - 1; } if(nind < ind) s[j][i] = -(s[j][0]) - 1; if(nind == ind){ if(lst == 1){ if(i % 2) s[j][i] = -(1 ^ s[j][0]) - 1; else s[j][i] = -(s[j][0]) - 1; } else{ int v = lst - 1; if(i & (1 << v)) s[j][i] = 2 * v; else s[j][i] = 2 * v - 1; } } } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...