Submission #1020530

#TimeUsernameProblemLanguageResultExecution timeMemory
1020530huutuanUnscrambling a Messy Bug (IOI16_messy)C++14
100 / 100
1 ms604 KiB
#include <vector> #include "messy.h" #include <bits/stdc++.h> using namespace std; vector<int> restore_permutation(int n, int w, int r) { int lg=31-__builtin_clz(n); vector<int> ans(n); string s(n, '0'); for (int i=0; i<lg; ++i){ vector<int> v; for (int j=0; j<n; ++j) if (j>>i&1) v.push_back(j); for (int j:v){ s[j]^=1; add_element(s); s[j]^=1; } for (int j:v) s[j]^=1; } compile_set(); string t(n, '0'); for (int i=0; i<lg; ++i){ vector<int> v; for (int j=0; j<n; ++j){ t[j]^=1; if (check_element(t)) v.push_back(j); t[j]^=1; } for (int j:v) ans[j]^=1<<i, t[j]^=1; } return ans; }
#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...