# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
769081 | SanguineChameleon | Mechanical Doll (IOI18_doll) | C++17 | 59 ms | 10072 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 "doll.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> A, C, X, Y, all_cnt, cur_cnt;
int N, M, K;
void build(int id, int depth, int cur) {
if (depth == K - 1) {
X[id - 1] = (cur < N - 1 ? A[cur + 1] : (cur == ((1 << K) - 1) ? 0 : -1));
cur += 1 << depth;
Y[id - 1] = (cur < N - 1 ? A[cur + 1] : (cur == ((1 << K) - 1) ? 0 : -1));
return;
}
X[id - 1] = -(id * 2);
Y[id - 1] = -(id * 2 + 1);
build(id * 2, depth + 1, cur);
build(id * 2 + 1, depth + 1, cur + (1 << depth));
}
void create_circuit(int _M, vector<int> _A) {
A = _A;
N = A.size();
M = _M;
all_cnt.resize(M + 1);
cur_cnt.resize(M + 1);
for (int i = 0; i < N; i++) {
all_cnt[A[i]]++;
}
bool sub3 = true;
# | 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... |