#include "secret.h"
using namespace std;
const int nmax = 1000 + 5;
using namespace std;
int n, a[nmax];
int tree[nmax << 2];
void build(int id, int l, int r){
if(l == r){
tree[id] = a[l];
return;
}
int mid = (r + l)/2;
build(id *2, l, mid);
build(id *2 + 1, mid + 1, r);
tree[id] = Secret(tree[id *2 ], tree[id * 1 + 1]);
}
int get(int id, int l, int r, int u, int v){
if(l >= u && r <= v) return tree[id];
int mid = (r + l) /2;
if(mid< u) return get(id * 2 + 1, mid + 1, r, u, v);
if(mid + 1 > v) return get(id * 2, l, mid, u, v);
return Secret(get(id* 2, l, mid, u, v), get(id * 2 + 1, mid + 1, r, u, v));
}
void Init(int N, int A[]){
n = N;
for(int i = 0; i < n; ++i) a[i] = A[i];
build(1, 0, n - 1);
}
int Query(int l, int r){
return get(1, 0, n - 1, l, r);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
66 ms |
3668 KB |
Wrong Answer: Query(222, 254) - expected : 34031541, actual : 805311939. |
2 |
Incorrect |
65 ms |
3484 KB |
Wrong Answer: Query(60, 375) - expected : 669221184, actual : 506462560. |
3 |
Incorrect |
72 ms |
3560 KB |
Wrong Answer: Query(211, 401) - expected : 674373968, actual : 268908622. |
4 |
Incorrect |
261 ms |
4412 KB |
Wrong Answer: Query(90, 497) - expected : 397934825, actual : 355631130. |
5 |
Incorrect |
259 ms |
4188 KB |
Wrong Answer: Query(587, 915) - expected : 752404486, actual : 216010076. |
6 |
Incorrect |
255 ms |
4264 KB |
Wrong Answer: Query(738, 741) - expected : 983692994, actual : 805880536. |
7 |
Incorrect |
251 ms |
4200 KB |
Wrong Answer: Query(84, 976) - expected : 742463504, actual : 66818154. |
8 |
Incorrect |
249 ms |
4380 KB |
Wrong Answer: Query(58, 987) - expected : 20022464, actual : 540468440. |
9 |
Incorrect |
247 ms |
4180 KB |
Wrong Answer: Query(33, 967) - expected : 676869696, actual : 146801575. |
10 |
Incorrect |
263 ms |
4180 KB |
Wrong Answer: Query(116, 961) - expected : 68487362, actual : 272616001. |