제출 #853670

#제출 시각아이디문제언어결과실행 시간메모리
853670hgmhcUnscrambling a Messy Bug (IOI16_messy)C++17
20 / 100
2 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__) inline vi flip(vi v, int k) { v[k] ^= 1; return v; } inline string str(vi v) { string r; for (const auto &e : v) r += '0'+e; return r; } vi restore_permutation(int n, int w, int r) { rep(i,1,n) add_element(string(i,'1')+string(n-i,'0')); compile_set(); vi p(n), b(n), ch(n); rep(i,0,n-1) { rep(j,0,n-1) if (!ch[j]) { if (check_element(str(flip(b,j)))) { ch[j] = 1; p[i] = j; b[j] = 1; break; } } } 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...