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>
using namespace std;
#include "messy.h"
std::vector<int> restore_permutation(int n, int w, int r) {
if (n * n <= r) {
for (int i = 1; i <= n; i++) {
add_element(string(i, '1') + string(n - i, '0'));
}
compile_set();
vector<int> ans(n, -1);
string cur(n, '?');
for (int i = 0; i < n; i++) {
int w = -1;
for (int k = 0; k < n; k++) if (cur[k] == '?') {
string tmp = cur;
for (int j = 0; j < n; j++) if (tmp[j] == '?') {
tmp[j] = j == k ? '1' : '0';
}
if (check_element(tmp)) {
cur[k] = '1';
w = k; break;
}
}
ans[w] = i;
}
return ans;
}
return std::vector<int>();
}
# | 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... |