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) {
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
vector<int> pos(n);
for (int i=0;i<n;i++) {
pos[i]=i;
}
string ss = string(n, '0');
for (int i=0;i<n;i++) {
ss[i]='1';
add_element(ss);
}
compile_set();
ss = string(n, '0');
vector<int> p(n);
shuffle(pos.begin(), pos.end(), rng);
for (int i=0;i<n;i++) {
for (int j:pos) {
if (ss[j] == '1') continue;
ss[j] = '1';
if (check_element(ss)) {
p[j] = i;
break;
}
ss[j] = '0';
}
}
return p;
}
# | 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... |