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>
#define pb push_back
#define vi vector<int>
#include "messy.h"
using namespace std;
vector<int> restore_permutation(int n, int w, int r) {
//add_element("0");
//compile_set();
//check_element("0");
for(int i=1;i<=n;i++){
string S(n,'0');
for(int l=0;l<i;l++)S[l]='1';
add_element(S);
}
compile_set();
string s(n,'0');
vi res(n);
for(int i=0;i<n;i++){
for(int l=0;l<n;l++){
if(s[l]=='1')continue;
s[l]='1';
if(check_element(s)){
res[l]=i;
break;
}else{
s[l]='0';
}
}
}
return res;
}
/*
8 256 256
1 3 2 0 7 5 6 4
8 256 256
0 1 4 3 2 5 6 7
*/
# | 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... |