# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
244484 | maximath_1 | Mechanical Doll (IOI18_doll) | C++11 | 206 ms | 14492 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> c, x, y, desti, state, l, r;
int id = 0, sz = 0;
int build(int nd, int tri){
if(tri == 0) return -1;
if(nd == 1) return id++;
int nw = - sz - 1; sz ++;
l[-nw] = build(nd/2, tri - min(nd/2, tri));
r[-nw] = build(nd/2, min(nd/2, tri));
return nw;
}
int dfs(int nw){
if(nw >= 0) return nw;
state[-nw] = 1 - state[-nw];
if(state[-nw]) return dfs(l[-nw]);
else return dfs(r[-nw]);
}
void create_circuit(int m, vector<int> a){
a.push_back(0);
int k = 1;
for(; k < a.size(); k *= 2);
Compilation message (stderr)
# | 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... |