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>
using namespace std;
const int N = 400000;
#include "doll.h"
int x[N], y[N], s;
int construct(vector<int> a) {
if (a.size() == 1) {
return a[0];
}
int u = ++s;
if (a.size() % 2 == 1) {
a.insert(a.begin(), -u);
}
vector<int> l, r;
for (int i = 0; i < (int) a.size(); ++i) {
(i % 2 == 0 ? l : r).push_back(a[i]);
}
x[u - 1] = construct(l);
y[u - 1] = construct(r);
return -u;
}
void create_circuit(int m, vector<int> a) {
a.push_back(0);
vector<int> c(m + 1, construct(a));
assert(s <= N);
answer(c, vector<int>(x, x + s), vector<int>(y, y + s));
}
# | 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... |