# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
522446 | dongliu0426 | Secret (JOI14_secret) | C++17 | 451 ms | 4372 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 "secret.h"
#define N 1000
#define L 9
int ll[N + 1], tt[L + 1][N];
void Init(int n, int *aa) {
int i, j;
for (i = 2; i <= n; i++)
ll[i] = ll[i >> 1] + 1;
for (i = 0; i < n; i++)
tt[0][i] = aa[i];
for (j = 1; 1 << j <= n; j++)
for (i = 0; i + (1 << j) <= n; i++)
tt[j][i] = Secret(tt[j - 1][i], tt[j - 1][i + (1 << (j - 1))]);
}
int Query(int l, int r) {
int d = ll[r - l + 1];
return Secret(tt[d][l], tt[d][r - (1 << d) + 1]);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |