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 <bits/stdc++.h>
#include "messy.h"
using namespace std;
vector<int> restore_permutation(int n, int w, int r)
{
for (int i = 1; i < n; i++)
{
string str(n, '0');
for (int j = i; j < n; j++) str[j] = '1';
add_element(str);
}
compile_set();
vector<int> res(n, -1);
for (int c = 0; c < n; c++)
{
string str(n, '1');
for (int i = 0; i < n; i++) if (res[i] != -1) str[i] = '0';
for (int i = 0; i < n; i++)
{
if (res[i] != -1) continue;
str[i] = '0';
if (check_element(str))
{
res[i] = c;
break;
}
str[i] = '1';
}
}
for (int i = 0; i < n; i++) if (res[i] == -1) res[i] = n - 1;
return res;
}
# | 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... |