# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
705225 | rainboy | Abracadabra (CEOI22_abracadabra) | C11 | 673 ms | 46172 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 <stdio.h>
#include <stdlib.h>
#define N 200000
#define N_ (1 << 18) /* N_ = pow2(ceil(log2(N))) */
#define Q 1000000
int min(int a, int b) { return a < b ? a : b; }
int *eh[N + 1], eo[N + 1];
void append(int t, int h) {
int o = eo[t]++;
if (o >= 2 && (o & o - 1) == 0)
eh[t] = (int *) realloc(eh[t], o * 2 * sizeof *eh[t]);
eh[t][o] = h;
}
int st[N_ * 2], n_;
void pul(int i) {
st[i] = st[i << 1 | 0] + st[i << 1 | 1];
}
void update(int i, int x) {
st[i += n_] = x;
while (i > 1)
pul(i >>= 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... |