# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1121801 | OmarAlimammadzade | Unscrambling a Messy Bug (IOI16_messy) | C++14 | 2 ms | 504 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.
// author - alimammadzade
#include "messy.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> restore_permutation(int n, int w, int r) {
vector<string> nums;
vector<int> res(n);
int query = 0;
iota(res.begin(), res.end(), 0);
string s = "";
for (int i = 0; i < n; i++) {
s += "1";
string q;
for (int j = 0; j < n - i - 1; j++) q += "0";
q += s;
add_element(q);
nums.push_back(q);
}
compile_set();
for (int i = 0; i < n; i++)
for (int j = n - 1; j >= n - i - 1; j--)
for (int k = 0; k < n - i - 1; k++) {
string a = nums[i];
swap(a[j], a[k]);
if (check_element(a)) {
swap(res[j], res[k]);
return res;
}
}
return res;
}
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... |