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 "doll.h"
//#include "grader.cpp"
using namespace std;
const int maxn = (int)1e5 + 7;
int sz;
void create_circuit(int M, vector<int> A) {
int N = A.size();
vector<int> C(M + 1);
vector<int> X, Y;
C[0] = A[0];
int tmp = N - 1;
while (tmp > 0) {
sz++;
tmp >>= 1;
}
if (sz) C[1] = -1;
else C[1] = 0;
X.resize(sz);
Y.resize(sz);
tmp = N - 1;
for (int i = 1; i <= sz; i++) {
if ((tmp >> (sz - i)) & 1) {
X[i - 1] = A[0];
} else {
X[i - 1] = -1;
}
Y[i - 1] = ((i == sz) ? 0 : -(i + 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... |