Submission #853665

#TimeUsernameProblemLanguageResultExecution timeMemory
853665hgmhcUnscrambling a Messy Bug (IOI16_messy)C++17
0 / 100
1 ms348 KiB
#include "messy.h" #include <bits/stdc++.h> using namespace std; using ii = pair<int,int>; using ll = long long; using vi = vector<int>; #define rep(i,a,b) for (auto i = (a); i <= (b); ++i) #define per(i,a,b) for (auto i = (b); i >= (a); --i) #define all(x) begin(x), end(x) #define siz(x) int((x).size()) #define Mup(x,y) x = max(x,y) #define mup(x,y) x = min(x,y) #define fi first #define se second #define dbg(...) fprintf(stderr,__VA_ARGS__) vi restore_permutation(int n, int w, int r) { assert(n==8); rep(i,1,8) { add_element(string(n-i,'0')+string(i,'1')); } compile_set(); vi p(n); iota(all(p),0); vi idx; rep(i,1,8) { if (!check_element(string(n-i,'0')+string(i,'1'))) { idx.push_back(n-i); } } swap(p[idx[0]],p[idx[0]-siz(idx)]); 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...