#include "secret.h"
#define N 1005
int n, *a, st[10][N];
void Init(int n_, int *a_)
{
n = n_; a = a_;
for (int i = 0; i < n; ++i) st[0][i] = a[i];
for (int h = 1; (1 << h) <= n; ++h)
{
for (int j = 0; j < n; ++j)
{
if (j + (1 << h) * 2 > n) continue;
st[h][j] = Secret(st[h-1][j], st[h-1][j+(1<<(h-1))]);
}
}
}
int Query(int l, int r)
{
int z = a[l++];
for (int h = 10; h >= 0; --h)
{
if ((1 << h) <= r-l+1)
{
z = Secret(z, st[h][l]);
l += 1 << h;
}
}
return z;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
96 ms |
3476 KB |
Wrong Answer: Query(51, 467) - expected : 268834016, actual : 822542345. |
2 |
Incorrect |
97 ms |
3536 KB |
Wrong Answer: Query(60, 375) - expected : 669221184, actual : 675492065. |
3 |
Incorrect |
97 ms |
3580 KB |
Wrong Answer: Query(111, 503) - expected : 353540466, actual : 144805964. |
4 |
Incorrect |
358 ms |
4192 KB |
Wrong Answer: Query(268, 969) - expected : 602423382, actual : 933232838. |
5 |
Incorrect |
352 ms |
4436 KB |
Wrong Answer: Query(587, 915) - expected : 752404486, actual : 700450834. |
6 |
Incorrect |
357 ms |
4192 KB |
Wrong Answer: Query(984, 993) - expected : 188728053, actual : 279560864. |
7 |
Incorrect |
353 ms |
4196 KB |
Wrong Answer: Query(84, 976) - expected : 742463504, actual : 230163507. |
8 |
Incorrect |
358 ms |
4216 KB |
Wrong Answer: Query(58, 987) - expected : 20022464, actual : 16232704. |
9 |
Incorrect |
353 ms |
4432 KB |
Wrong Answer: Query(33, 967) - expected : 676869696, actual : 831928622. |
10 |
Incorrect |
367 ms |
4192 KB |
Wrong Answer: Query(116, 961) - expected : 68487362, actual : 810576783. |