제출 #853668

#제출 시각아이디문제언어결과실행 시간메모리
853668hgmhcUnscrambling a Messy Bug (IOI16_messy)C++17
20 / 100
1 ms436 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; int a=-1, b=-1; rep(i,0,7) { if (check_element(string(i,'0')+string(n-i,'1'))) { a = i; } else break; } rep(i,a+1,7) { if (!check_element(string(i,'0')+string(n-i,'1'))) { b = i; } else break; } if (a != -1 and b != -1) swap(p[a],p[b]); 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...