#include "secret.h"
#include <bits/stdc++.h>
using namespace std;
const int inf = 1e3+9,lg = 12;
int n,cnt = 0;
int a[inf],Log2[inf],sparse[lg][inf];
vector<int> tmp;
void Init(int N, int A[]) {
n = N;
Log2[1] = 0;
for(int i=2;i<=n;i++)
Log2[i] = Log2[i/2] + 1;
for(int i=1;i<=n;i++)
a[i] = A[i-1],sparse[0][i] = a[i];
for(int j=1;j<lg;j++)
for(int i=1;i+(1<<j)-1<=n;i++)
sparse[j][i] = Secret( sparse[j-1][i],sparse[j-1][ i+(1<<(j-1)) ] ),cnt++;
//assert(cnt<=8000);
}
int Query(int L, int R) {
L++,R++;
int len = R-L+1;
int k = Log2[len];
return Secret( sparse[k][L] , sparse[k][R-(1<<k)+1] );
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
140 ms |
2552 KB |
Wrong Answer: Query(222, 254) - expected : 34031541, actual : 839935006. |
2 |
Incorrect |
138 ms |
2424 KB |
Wrong Answer: Query(60, 375) - expected : 669221184, actual : 73044041. |
3 |
Incorrect |
143 ms |
2424 KB |
Wrong Answer: Query(211, 401) - expected : 674373968, actual : 951413062. |
4 |
Incorrect |
509 ms |
4496 KB |
Wrong Answer: Query(90, 497) - expected : 397934825, actual : 889372840. |
5 |
Incorrect |
510 ms |
4344 KB |
Wrong Answer: Query(587, 915) - expected : 752404486, actual : 389074008. |
6 |
Incorrect |
515 ms |
4360 KB |
Wrong Answer: Query(915, 915) - expected : 282904741, actual : 31281100. |
7 |
Incorrect |
515 ms |
4352 KB |
Wrong Answer: Query(84, 976) - expected : 742463504, actual : 709920818. |
8 |
Incorrect |
513 ms |
4472 KB |
Wrong Answer: Query(58, 987) - expected : 20022464, actual : 225603928. |
9 |
Incorrect |
527 ms |
4344 KB |
Wrong Answer: Query(33, 967) - expected : 676869696, actual : 819205962. |
10 |
Incorrect |
515 ms |
4344 KB |
Wrong Answer: Query(116, 961) - expected : 68487362, actual : 538241930. |