Submission #430573

#TimeUsernameProblemLanguageResultExecution timeMemory
430573TangentUnscrambling a Messy Bug (IOI16_messy)C++17
38 / 100
1 ms332 KiB
#include "messy.h" #include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vii; typedef vector<ll> vll; typedef vector<pii> vpii; typedef vector<pll> vpll; typedef vector<vii> vvii; typedef vector<vll> vvll; typedef vector<vpii> vvpii; typedef vector<vpll> vvpll; #define ffor(i, a, b) for (ll i = (a); i < (ll)(b); i++) #define fford(i, a, b) for (ll i = (a); i > (ll)(b); i--) #define rep(i, n) ffor(i, 0, n) #define forin(x, a) for (auto &x: a) #define all(a) a.begin(), a.end() std::vector<int> restore_permutation(int n, int w, int r) { string el(n, '0'); rep(i, n - 1) { el[i] = '1'; add_element(el); } compile_set(); vii res(n); set<int> rem; rep(i, n) { rem.emplace(i); } string curr(n, '0'); int cnt = 0; while (rem.size() > 1) { forin(x, rem) { curr[x] = '1'; if (check_element(curr)) { res[x] = cnt++; rem.erase(x); break; } curr[x] = '0'; } } res[*rem.begin()] = cnt; return res; }
#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...