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 "messy.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> restore_permutation(int n, int w, int r) {
string adder = "";
for (int i = 0; i < n; i++) adder += '1';
for (int i = 0; i < n-1; i++){
adder[i] = '0';
//cout << "adding " << adder << endl;
add_element(adder);
}
compile_set();
string checker = "";
vector<int> ans; ans.assign(n,-1);
for (int i = 0; i < n; i++) checker += '1';
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++){
if (ans[j] == -1){
if (i == n-1){
ans[j] = i;
}
checker[j] = '0';
int result = check_element(checker);
//cout << "checking " << checker << endl;
if (result){
//cout << checker << " is in the set, ans[" <<j << "] = " << i << endl;
ans[j] = i;
break;
}
else{
checker[j] = '1';
}
}
}
}
return ans;
}
# | 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... |