# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
32172 | gs14004 | Synchronization (JOI13_synchronization) | C++14 | 256 ms | 25324 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;
typedef pair<int, int> pi;
const int MAXN = 200005;
typedef long long lint;
struct lct{
struct node{
node *p, *l, *r, *pp;
int idx;
node(int _idx){
p = l = r = pp = NULL;
idx = _idx;
}
}*n[MAXN];
void init(int v){
for(int i=1; i<=v; i++) n[i] = new node(i);
}
void rotate(node *x){
if(!x->p) return;
node *p = x->p;
bool is_left = (p->l == x);
node *b = (is_left ? x->r : x->l);
x->p = p->p;
if(x->p && x->p->l == p) x->p->l = x;
if(x->p && x->p->r == p) x->p->r = x;
if(is_left){
if(b) b->p = p;
p->l = b;
p->p = x;
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... |