Submission #414518

#TimeUsernameProblemLanguageResultExecution timeMemory
414518timmyfengMechanical Doll (IOI18_doll)C++17
37 / 100
223 ms13244 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...