# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1230204 | vidux | Unscrambling a Messy Bug (IOI16_messy) | C++17 | 0 ms | 328 KiB |
#include "messy.h"
#include <bits/stdc++.h>
#define fi first
#define se second
#define ALL(x) (x.begin()), (x.end())
#define DEBUG(x) cerr << #x << ": " << x << endl;
#define DEBUG_ARR(x) cerr << #x << ": "; for (auto &y : x) cout << y << " "; cout << endl;
#define SZ(x) ((int)x.size())
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
//add_element("0");
//compile_set();
//check_element("0");
std::vector<int> restore_permutation(int n, int w, int r) {
{
string a(n, '0');
for (int i = 0; i < n; i++) {
a[i] = '1';
add_element(a);
}
}
compile_set();
vi ans(n);
vi fixed(n);
for (int i = 0; i < n; i++) {
string a(n, '0');
for (int j = 0; j < n; j++) a[j] += fixed[j];
for (int j = 0; j < n; j++) if (!fixed[j]) {
string b = a;
b[j]++;
bool ok = check_element(b);
if (ok) {
fixed[j] = 1;
ans[j] = i;
}
}
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |