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"
vector<int> restore_permutation(int n, int w, int r) {
string mask(n, '0');
for (int i = 1; i < n; i *= 2) {
string new_mask(n, '0');
for (int j = 0; j < n; ++j) {
if ((i & j) > 0) {
new_mask[j] = '1';
mask[j] ^= '0' ^ '1';
add_element(mask);
mask[j] ^= '0' ^ '1';
}
}
mask = new_mask;
}
compile_set();
vector<int> ans(n);
mask = string(n, '0');
for (int i = 1; i < n; i *= 2) {
string new_mask(n, '0');
for (int j = 0; j < n; ++j) {
mask[j] ^= '0' ^ '1';
if (check_element(mask)) {
new_mask[j] = '1';
ans[j] += i;
}
mask[j] ^= '0' ^ '1';
}
mask = new_mask;
}
return ans;
}
# | 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... |