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;
#define n N
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define fi first
#define se second
int n;
vector<int> p;
void solve() {
string add(n, '0');
for(int i = 0; i < n; i++) {
add[i] = '1';
add_element(add);
}
compile_set();
string check(n, '0');
for(int k = 0; k < n; k++) {
for(int i = 0; i < n; i++) {
if(p[i] != -1) {
continue;
}
check[i] = '1';
if(check_element(check)) {
p[i] = k;
break;
}
check[i] = '0';
}
}
}
#undef n
vector<int> restore_permutation(int n, int w, int r) {
N = n;
p.assign(N, -1);
solve();
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... |