# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1121915 | ElayV13 | Unscrambling a Messy Bug (IOI16_messy) | C++17 | 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.
#include "messy.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> restore_permutation(int n, int w, int r) {
vector < int > ans(n);
vector < string > s;
for(int i = 0;i < n - 1;i++)
{
string q = "";
for(int j = 0;j <= i;j++) q = q + '0';
for(int j = i + 1;j < n;j++) q = q + '1';
add_element(q);
s.push_back(q);
}
compile_set();
for(int i = 0;i < n;i++)
{
for(int j = i;j < n;j++)
{
bool f = 1;
for(int ii = 0;ii < n;ii++)
{
string q = s[ii];
swap(q[i] , q[j]);
f &= check_element(q);
}
if(f)
{
for(int ii = 0;ii < n;ii++)
{
ans[ii] = ii;
}
swap(ans[i], ans[j]);
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... |