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"
string make_string(vector<int> bits){
string s;
int n=bits.size();
for(int i=0;i<n;i++){
if(bits[i])s+="1";
else s+="0";
}
return s;
}
vector<int> restore_permutation(int n, int w, int r) {
vector<int> p(n);
set<int> used;
vector<int> strings(n,0);
for(int i=0;i<n;i++){
strings[i]=1;
add_element(make_string(strings));
}
compile_set();
vector<int> query(n,0);
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(used.count(j))continue;
query[j]=1;
if(check_element(make_string(query))){
used.insert(j);
p[j]=i;
break;
}
query[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... |