# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1160675 | sleepntsheep | Grapevine (NOI22_grapevine) | C11 | 1402 ms | 268152 KiB |
#include <stdio.h>
#include <stdlib.h>
#define N 200005
#define NL (N*18)
int n, qqq, n0, *eh[N], eo[N], e2v[N], w[N]
, sz[N], dead[N], dfn[20][N], out[20][N]
, cdep[N], cpar[N], nn[N], fruity[N], A[NL], L[NL], R[NL], rt[N], ii;
void sset(int *v, int l, int r, int p, int k) {
if (! *v)
*v = ++ii;
if (l == r) {
A[*v] = k;
return;
}
if (p <= (l + r) / 2)
sset(L + *v, l, (l + r) / 2, p, k);
else
sset(R + *v, (l + r) / 2 + 1, r, p, k);
}
int sget(int v, int l, int r, int k) {
if (l == r)
return A[v];
if (k <= (l + r) / 2)
return sget(L[v], l, (l + r) / 2, k);
return sget(R[v], (l + r) / 2 + 1, r, k);
}
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... |