#include "secret.h"
int precalc[10][1000];
void Init (int N, int A[]) {
for(int i = 0; i < N; i++) precalc[0][i] = A[i];
for(int k = 1; (1<<k) < N; k++) {
for(int i = 0; i <= N - (1<<k); i++) precalc[k][i] = Secret(precalc[k-1][i], precalc[k-1][i + (1<<(k-1))]);
}
}
int Query(int L, int R) {
int len = (R - L + 1);
int ret = -1;
for(int k = 0; k < 10; k++) if((len >> k) & 1) {
if(ret < 0) ret = precalc[k][L];
else ret = Secret(ret, precalc[k][L]);
L += k;
}
return ret;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
156 ms |
5148 KB |
Wrong Answer: Query(222, 254) - expected : 34031541, actual : 554987478. |
2 |
Incorrect |
156 ms |
5148 KB |
Wrong Answer: Query(60, 375) - expected : 669221184, actual : 316870753. |
3 |
Incorrect |
159 ms |
5148 KB |
Wrong Answer: Query(211, 401) - expected : 674373968, actual : 495991150. |
4 |
Incorrect |
633 ms |
5148 KB |
Wrong Answer: Query(90, 497) - expected : 397934825, actual : 555450957. |
5 |
Incorrect |
596 ms |
5148 KB |
Wrong Answer: Query(587, 915) - expected : 752404486, actual : 448435468. |
6 |
Incorrect |
586 ms |
5148 KB |
Wrong Answer: Query(200, 208) - expected : 277813445, actual : 967114301. |
7 |
Incorrect |
593 ms |
5148 KB |
Wrong Answer: Query(84, 976) - expected : 742463504, actual : 720906338. |
8 |
Incorrect |
613 ms |
5148 KB |
Wrong Answer: Query(58, 987) - expected : 20022464, actual : 338716872. |
9 |
Incorrect |
596 ms |
5148 KB |
Wrong Answer: Query(33, 967) - expected : 676869696, actual : 285478824. |
10 |
Incorrect |
599 ms |
5148 KB |
Wrong Answer: Query(116, 961) - expected : 68487362, actual : 272067650. |