# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
106723 | ppnxblstr | Mechanical Doll (IOI18_doll) | C++14 | 323 ms | 42436 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;
int swcnt;
int newswitch(){
return ++swcnt;
}
class fakeswitch{
public:
fakeswitch* l;
fakeswitch* r;
bool t;
int val;
fakeswitch(int x = -1) : l(nullptr), r(nullptr), val(x), t(false) {}
};
fakeswitch* buildfakesw(int lv){
if(lv == 0) return new fakeswitch(0);
fakeswitch* cur = new fakeswitch();
cur->l = buildfakesw(lv-1);
cur->r = buildfakesw(lv-1);
return cur;
}
void trav(fakeswitch* cur, int key){
if(cur->l == nullptr && cur->r == nullptr){
cur->val = key;
return;
}
if(cur->t) trav(cur->r, key);
else trav(cur->l, key);
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... |