# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
851848 |
2023-09-20T17:13:49 Z |
mareksb |
Secret (JOI14_secret) |
C++14 |
|
376 ms |
4520 KB |
#include "secret.h"
#include <bits/stdc++.h>
using namespace std;
int num_of_elements = 0;
long long mas[1010];
long long segt[4010];
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 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 |
100 ms |
2896 KB |
Wrong Answer: Query(222, 254) - expected : 34031541, actual : 1395990149. |
2 |
Incorrect |
97 ms |
2732 KB |
Wrong Answer: Query(60, 375) - expected : 669221184, actual : 1051128059. |
3 |
Incorrect |
98 ms |
2648 KB |
Wrong Answer: Query(211, 401) - expected : 674373968, actual : -1941911076. |
4 |
Incorrect |
371 ms |
4432 KB |
Wrong Answer: Query(90, 497) - expected : 397934825, actual : -1931764879. |
5 |
Incorrect |
371 ms |
4520 KB |
Wrong Answer: Query(587, 915) - expected : 752404486, actual : -922515955. |
6 |
Incorrect |
370 ms |
4432 KB |
Wrong Answer: Query(738, 741) - expected : 983692994, actual : 905502165. |
7 |
Incorrect |
370 ms |
4268 KB |
Wrong Answer: Query(84, 976) - expected : 742463504, actual : 788690354. |
8 |
Incorrect |
373 ms |
4420 KB |
Wrong Answer: Query(58, 987) - expected : 20022464, actual : 521277386. |
9 |
Incorrect |
368 ms |
4432 KB |
Wrong Answer: Query(33, 967) - expected : 676869696, actual : 1119256918. |
10 |
Incorrect |
376 ms |
4432 KB |
Wrong Answer: Query(116, 961) - expected : 68487362, actual : 2080976420. |