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;
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.pb(l);
break;
}else{
s[l]='0';
}
}
}
return res;
}
/*
8 256 256
0 1 2 3 4 5 7 6
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... |