Submission #522444

#TimeUsernameProblemLanguageResultExecution timeMemory
522444dongliu0426Secret (JOI14_secret)C++17
Compilation error
0 ms0 KiB
#include <stdio.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)]);
      |                                                        ~~^~~
secret.cpp:17:15: error: 'Secret' was not declared in this scope
   17 |    tt[j][i] = Secret(tt[j - 1][i], tt[j - 1][i + (1 << j - 1)]);
      |               ^~~~~~
secret.cpp: In function 'int Query(int, int)':
secret.cpp:23:9: error: 'Secret' was not declared in this scope
   23 |  return Secret(tt[d][l], tt[d][r - (1 << d) + 1]);
      |         ^~~~~~