#include "secret.h"
using namespace std;
int stuff[10][1005];
int global_n;
void build(int stage,int st,int dr,int a[]){
if(st == dr){
stuff[stage][st] = a[st];
return ;
}
int mid = (st + dr) / 2;
stuff[stage][mid] = a[mid];
stuff[stage][mid + 1] = a[mid + 1];
for(int i = mid - 1;i >= st;i--){
stuff[stage][i] = Secret(a[i],stuff[stage][i + 1]);
}
for(int i = mid + 2;i <= dr;i++){
stuff[stage][i] = Secret(stuff[stage][i - 1],a[i]);
}
build(stage + 1,st,mid,a);
build(stage + 1,mid + 1,dr,a);
}
int query(int stage,int st,int dr,int l,int r){
int mid = (st + dr) / 2;
if(l <= mid && mid <= r){
if(r == mid){
return stuff[stage][l];
}
return Secret(stuff[stage][l],stuff[stage][r]);
}
else if(mid < l){
return query(stage + 1,mid + 1,dr,l,r);
}
else{
return query(stage + 1,st,mid,l,r);
}
}
void Init(int n, int a[]) {
return ;
global_n = n;
build(0,0,n - 1,a);
}
int Query(int l, int r) {
return 0;
return query(0,0,global_n - 1,l,r);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
155 ms |
2524 KB |
Wrong Answer: Query(222, 254) - expected : 34031541, actual : 0. |
2 |
Incorrect |
151 ms |
2552 KB |
Wrong Answer: Query(60, 375) - expected : 669221184, actual : 0. |
3 |
Incorrect |
154 ms |
2428 KB |
Wrong Answer: Query(211, 401) - expected : 674373968, actual : 0. |
4 |
Incorrect |
569 ms |
4408 KB |
Wrong Answer: Query(90, 497) - expected : 397934825, actual : 0. |
5 |
Incorrect |
558 ms |
4404 KB |
Wrong Answer: Query(587, 915) - expected : 752404486, actual : 0. |
6 |
Incorrect |
576 ms |
4360 KB |
Wrong Answer: Query(915, 915) - expected : 282904741, actual : 0. |
7 |
Incorrect |
562 ms |
4440 KB |
Wrong Answer: Query(84, 976) - expected : 742463504, actual : 0. |
8 |
Incorrect |
564 ms |
4344 KB |
Wrong Answer: Query(58, 987) - expected : 20022464, actual : 0. |
9 |
Incorrect |
589 ms |
4500 KB |
Wrong Answer: Query(33, 967) - expected : 676869696, actual : 0. |
10 |
Incorrect |
564 ms |
4388 KB |
Wrong Answer: Query(116, 961) - expected : 68487362, actual : 0. |