# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
192706 | imeimi2000 | Dancing Elephants (IOI11_elephants) | C++17 | 1704 ms | 28344 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>
#define fs first
#define se second
using namespace std;
typedef pair<int, int> pii;
const int inf = 1e9 + 1;
const int rinf = inf + inf;
const int linf = -1;
int n, l;
namespace LCT {
struct node {
int L, R, P;
int cnt, sum;
} ns[300010];
void set_cnt(int x, int v) {
ns[x].cnt = ns[x].sum = v;
}
void update(int x) {
ns[x].sum = ns[x].cnt;
if (ns[x].L) ns[x].sum += ns[ns[x].L].sum;
if (ns[x].R) ns[x].sum += ns[ns[x].R].sum;
}
bool is_root(int x) {
return ns[x].P == 0 || ns[ns[x].P].L != x && ns[ns[x].P].R != x;
}
void rotate(int x) {
int p = ns[x].P;
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... |