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;
vector<int> restore_permutation(int n, int w, int r) {
// check_element("0");
vector<int> ans(n , 0);
int b = 0;
for(int i = 0 ; i < 10 ; i++){
if(n == (1 << i)) b = i;
}
for(int i = 0 ; i < b ; i++){
int cur = (1 << i) - 1;
for(int j = 0 ; j < n ; j++){
if((j & (1 << i)) == 0) continue;
string s;
for(int k = 0 ; k < n ; k++){
if((k & cur) != (j & cur) || j == k) s.push_back('1');
else s.push_back('0');
}
add_element(s);
}
}
compile_set();
for(int i = 0 ; i < b ; i++){
vector<int> vec;
for(int j = 0 ; j < n ; j++){
string s;
for(int k = 0 ; k < n ; k++){
if(ans[j] != ans[k] || j == k) s.push_back('1');
else s.push_back('0');
}
vec.push_back(check_element(s));
}
for(int j = 0 ; j < n ; j++){
if(vec[j]) ans[j] |= (1 << i);
}
}
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... |