Submission #522446

#TimeUsernameProblemLanguageResultExecution timeMemory
522446dongliu0426Secret (JOI14_secret)C++17
0 / 100
451 ms4372 KiB
#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 timeMemoryGrader output
Fetching results...