| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1295625 | goulthen | Unscrambling a Messy Bug (IOI16_messy) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#include "messy.h"
using namespace std;
vector<int> restore_permutation(int n, int w, int r) {
vector<int> p(n);
string pfx = "";
rep(i,0,n-1) {
pfx += '0';
string cur = pfx;
rep(j,i+1,n-1) cur+='1';
add_element(cur);
base.pb(cur);
}
compile_set();
rep(i,0,n-1) {
string base = "";
rep(j,0,n-1) base+='0';
rep(j,0,n-1) {
if(base[j] == '1') continue;
base[j] = '1';
if(check_element(base)) {
p[i] = j;
break;
}
base[j] = '0';
}
}
return p;
}
