# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
25496 | zigui | Synchronization (JOI13_synchronization) | C++14 | 306 ms | 24540 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.
#define _CRT_SECURE_NO_WARNINGS
#include<vector>
#include<algorithm>
#include<stdio.h>
using namespace std;
const int MX = 2e5;
struct node{
node *link[2], *par, *path_parent;
};
struct linkcuttree{
node N[MX];
void clear(int s){
for(int i=0;i<s;i++) N[i].link[0] = N[i].link[1] = N[i].par = N[i].path_parent = 0;
}
inline int dir(node *x){ return x->par->link[0] != x; }
void rotate(node *n) // To
{
if( !n->par ) return;
node *p = n->par;
int d = dir(n);
n->path_parent = p->path_parent; p->path_parent = NULL;
p->link[d] = n->link[!d]; if( n->link[!d] ) n->link[!d]->par = p;
n->par = p->par; if( p->par ) p->par->link[ dir(p) ] = n;
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... |