# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
645728 | rainboy | Fish 2 (JOI22_fish2) | C11 | 4078 ms | 4200 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 <string.h>
#define N 100000
#define N_ (1 << 17) /* N_ = pow2(ceil(log2(N + 1))) */
#define INF 0x7fffffff
#define LG 30
int min(int a, int b) { return a < b ? a : b; }
int max(int a, int b) { return a > b ? a : b; }
int aa[N], st1[N_ * 2], st2[N_ * 2], kk2[N_ * 2], lz2[N_], h_, n_;
void pul1(int i) {
st1[i] = st1[i << 1 | 0] <= INF - st1[i << 1 | 1] ? st1[i << 1 | 0] + st1[i << 1 | 1] : INF;
}
void build(int *aa, int n) {
int i;
h_ = 0;
while (1 << h_ <= n)
h_++;
n_ = 1 << h_;
for (i = 0; i < n; i++)
st1[n_ + i] = aa[i], kk2[n_ + i] = 1;
for (i = n_ - 1; i > 0; i--)
pul1(i);
}
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... |