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 "doll.h"
#include<bits/stdc++.h>
using namespace std;
vector<int> X, Y;
void fin(int x, int n, int par, bool ok, int val, vector<int> &A, bool flag){
if((x|val) >= n){
if(ok)X[par] = A[x];
else Y[par] = A[x];
}
else{
int no = X.size();
if(!flag){
if(ok)X[par] = -no-1;
else Y[par] = -no-1;
}
X.push_back(0);
Y.push_back(0);
fin(x,n,no,1,val<<1,A,0);
fin(x|val,n,no,0,val<<1,A,0);
}
}
void create_circuit(int m, vector<int> A) {
A.push_back(-1);
int n = A.size();
while((int)A.size() < (1<<(int)ceil(log2(n)))){
A.push_back(-1);
}
A.back() = 0;
n = A.size();
vector<int> C(m + 1,-1);
vector<int> H(m + 1);
fin(0,n,-1,0,1,A,1);
answer(C, X, Y);
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |