Submission #522445

#TimeUsernameProblemLanguageResultExecution timeMemory
522445dongliu0426Secret (JOI14_secret)C++17
0 / 100
449 ms4432 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]); }

Compilation message (stderr)

secret.cpp: In function 'void Init(int, int*)':
secret.cpp:17:58: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   17 |    tt[j][i] = Secret(tt[j - 1][i], tt[j - 1][i + (1 << j - 1)]);
      |                                                        ~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...