# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
851852 |
2023-09-20T17:16:39 Z |
mareksb |
Secret (JOI14_secret) |
C++14 |
|
375 ms |
4528 KB |
#include "secret.h"
#include <bits/stdc++.h>
using namespace std;
int num_of_elements = 0;
int mas[1000];
int segt[4000];
void init(int pos=1,int l=1, int r=num_of_elements){
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, 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);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
102 ms |
2648 KB |
Wrong Answer: Query(222, 254) - expected : 34031541, actual : 34031537. |
2 |
Incorrect |
100 ms |
2732 KB |
Wrong Answer: Query(102, 157) - expected : 32612619, actual : 569483529. |
3 |
Incorrect |
99 ms |
2896 KB |
Wrong Answer: Query(67, 224) - expected : 202440844, actual : 739311628. |
4 |
Incorrect |
368 ms |
4272 KB |
Wrong Answer: Query(727, 872) - expected : 870334875, actual : 870334619. |
5 |
Incorrect |
372 ms |
4412 KB |
Wrong Answer: Query(761, 790) - expected : 112945480, actual : 112871752. |
6 |
Incorrect |
373 ms |
4196 KB |
Wrong Answer: Query(915, 915) - expected : 282904741, actual : 278446241. |
7 |
Incorrect |
372 ms |
4320 KB |
Wrong Answer: Query(0, 993) - expected : 589312106, actual : 73532490. |
8 |
Incorrect |
375 ms |
4264 KB |
Wrong Answer: Query(0, 839) - expected : 428261768, actual : 142034200. |
9 |
Incorrect |
373 ms |
4528 KB |
Wrong Answer: Query(0, 930) - expected : 424418475, actual : 402930595. |
10 |
Incorrect |
371 ms |
4264 KB |
Wrong Answer: Query(0, 893) - expected : 611994251, actual : 6996554. |