Submission #935193

#TimeUsernameProblemLanguageResultExecution timeMemory
935193MackerUnscrambling a Messy Bug (IOI16_messy)C++14
100 / 100
3 ms688 KiB
#include "messy.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; #define all(v) v.begin(), v.end() #define FOR(i, n) for (int i = 0; i < n; i++) std::vector<int> restore_permutation(int n, int w, int r) { int log = (int)(log2(n) + 0.5); FOR(l, log){ FOR(i, n){ if(i & (1 << l)){ string t(n, '0'); FOR(j, n){ bool on = 0; FOR(k, l){ if(((j & (1 << k)) ^ (i & (1 << k)))) on = 1; } if(on) t[j] = '1'; } t[i] = '1'; add_element(t); } } } compile_set(); vector<int> p(n, 0); FOR(l, log){ FOR(i, n){ string t(n, '0'); FOR(j, n){ bool on = 0; FOR(k, l){ if(((p[j] & (1 << k)) ^ (p[i] & (1 << k)))) on = 1; } if(on) t[j] = '1'; } t[i] = '1'; if(check_element(t)){ p[i] |= (1 << l); } } } return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...