# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
387929 | rama_pang | Synchronization (JOI13_synchronization) | C++17 | 140 ms | 13160 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>
using namespace std;
class SplayTree {
public:
struct Node {
int ch[2] = {0, 0}, p = 0;
int val = 0;
Node(int v = 0) : val(v) {}
};
vector<Node> T;
SplayTree(int n) : T(n + 1) {}
void Push(int x) {
}
void Pull(int x) {
Push(T[x].ch[0]), Push(T[x].ch[1]);
}
void Set(int p, int d, int u) {
T[p].ch[d] = u; T[u].p = p; Pull(p);
}
int Dir(int x) {
if (!x || !T[x].p) return -1;
return T[T[x].p].ch[0] == x ? 0 : T[T[x].p].ch[1] == x ? 1 : -1;
}
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... |