# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
756351 | drdilyor | Mechanical Doll (IOI18_doll) | C++17 | 163 ms | 14384 KiB |
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"
using namespace std;
using ll = long long;
void create_circuit(int m, std::vector<int> arr) {
vector<int> c(m+1);
vector<int> x, y;
auto add = [&](int a, int b){
x.push_back(a), y.push_back(b);
return -(int)x.size();
};
auto tree = [&](auto& tree, vector<int> nxt) {
if (nxt.size() == 1) {
return nxt[0];
}
vector<int> odd, even;
for (int i = 0; i < (int)nxt.size(); i += 2) {
odd.push_back(nxt[i]);
even.push_back(nxt[i+1]);
}
int t1 = tree(tree, odd);
int t2 = tree(tree, even);
return add(t1, t2);
};
int n = arr.size();
vector<vector<int>> nxt(m+1);
arr.push_back(0);
# | 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... |