#include "secret.h"
#include <bits/stdc++.h>
using namespace std;
int num_of_elements = 0;
int mas[1000];
int segt[4010];
void init(int pos=1,int l=1, int r=num_of_elements-1){
if(l==r){
segt[pos]=mas[l];
return;
}
int mid=(l+r)/2;
init(pos*2,l,mid);
init(pos*2+1,mid+1, r);
segt[pos]=Secret(segt[pos*2],segt[pos*2+1]);
}
int sum(int i, int j, int l=1, int r=num_of_elements-1, int pos=1){
if(j<l||r<i)return 0;
if(i<=l&&r<=j)return segt[pos];
int mid=(l+r)/2;
return Secret(sum(i,j,l,mid,pos*2),sum(i,j,mid+1,r,pos*2+1));
}
void Init(int N, int A[]){
num_of_elements=N;
for(int i=0;i<N;i++){
mas[i]=A[i];
}
init();
}
int Query(int L, int R){
return sum(L,R);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
100 ms |
2716 KB |
Wrong Answer: Query(222, 254) - expected : 34031541, actual : 34031537. |
2 |
Incorrect |
98 ms |
2648 KB |
Wrong Answer: Query(102, 157) - expected : 32612619, actual : 569483529. |
3 |
Incorrect |
99 ms |
2904 KB |
Wrong Answer: Query(67, 224) - expected : 202440844, actual : 739311628. |
4 |
Incorrect |
365 ms |
4236 KB |
Wrong Answer: Query(727, 872) - expected : 870334875, actual : 870334619. |
5 |
Incorrect |
371 ms |
4432 KB |
Wrong Answer: Query(761, 790) - expected : 112945480, actual : 112871752. |
6 |
Incorrect |
378 ms |
4648 KB |
Wrong Answer: Query(915, 915) - expected : 282904741, actual : 278446241. |
7 |
Incorrect |
371 ms |
4176 KB |
Wrong Answer: Query(0, 993) - expected : 589312106, actual : 73532490. |
8 |
Incorrect |
374 ms |
4272 KB |
Wrong Answer: Query(0, 839) - expected : 428261768, actual : 142034200. |
9 |
Incorrect |
378 ms |
4264 KB |
Wrong Answer: Query(0, 930) - expected : 424418475, actual : 402930595. |
10 |
Incorrect |
371 ms |
4196 KB |
Wrong Answer: Query(0, 893) - expected : 611994251, actual : 6996554. |