# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
66975 | Talant | Unscrambling a Messy Bug (IOI16_messy) | C++17 | 2 ms | 384 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "messy.h"
//#include "grader.cpp"
#include <bits/stdc++.h>
#define sc second
#define fr first
#define mk make_pair
#define pb push_back
using namespace std;
const int N = (1e6 + 5);
const int inf = (1e9 + 7);
string a;
vector <int> v;
vector<int> restore_permutation(int n, int w, int r) {
for (int i = 0; i < n; i ++)
a += '0',v.pb(i);
for (int i = n - 1; i >= 0; i --) {
a[i] = '1';
add_element(a);
}
compile_set();
for (int i = 0; i < n; i ++) a[i] = '0';
for (int i = n - 1; i >= 0; i --) {
a[i] = '1';
for (int j = 0; j < i; j ++) {
string c = a;
swap(c[j],c[i]);
if (check_element(c)) {
swap(v[j],v[i]);
return v;
}
}
}
}
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... |