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;
void create_circuit(int M, vector<int> A) {
/* if (M == A.size()){
vector<int> C(M + 1);
C[0] = A[0];
int N = A.size();
for (int i = 0; i<N-1; ++i) {
C[A[i]] = A[i+1];
}
C[A[N-1]] = 0;
vector<int> X,Y;
answer(C, X, Y);
}
*/ if (M == 1){
int pow2 = 1, N = A.size();
while (pow2 < N) pow2 <<= 1;
vector<int> X(2*pow2),Y(2*pow2);
for (int i=0; i<pow2; ++i){
X[i] = -(2*(i+1)+1);
Y[i] = -(2*(i+1)+2);
}
while (pow2 > N+1){
pow2--;
X.pop_back();
Y.pop_back();
}
vector<int> C(M+1);
C[0] = 1;
C[1] = -1;
X[X.size()-1] = 1;
Y[Y.size()-1] = 0;
int idx = X.size()-2, crt = N-1;
while (crt > 0){
X[idx] = 1;
Y[idx] = 1;
idx--;
crt -= 2;
}
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... |