# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
851843 |
2023-09-20T17:09:41 Z |
mareksb |
Secret (JOI14_secret) |
C++14 |
|
374 ms |
4440 KB |
#include "secret.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 1000;
int coefs[1000];
int mas[1000];
int segt[4000];
void init(int pos=1,int l=1, int r=N){
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=N, 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[]){
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 |
2788 KB |
Wrong Answer: Query(222, 254) - expected : 34031541, actual : 1940912428. |
2 |
Incorrect |
99 ms |
2824 KB |
Wrong Answer: Query(60, 375) - expected : 669221184, actual : -1941683669. |
3 |
Incorrect |
99 ms |
2820 KB |
Wrong Answer: Query(211, 401) - expected : 674373968, actual : -1874109093. |
4 |
Incorrect |
372 ms |
4436 KB |
Wrong Answer: Query(90, 497) - expected : 397934825, actual : -1931764879. |
5 |
Incorrect |
371 ms |
4440 KB |
Wrong Answer: Query(587, 915) - expected : 752404486, actual : -922515955. |
6 |
Incorrect |
372 ms |
4436 KB |
Wrong Answer: Query(738, 741) - expected : 983692994, actual : 905502165. |
7 |
Incorrect |
369 ms |
4352 KB |
Wrong Answer: Query(84, 976) - expected : 742463504, actual : 788690354. |
8 |
Incorrect |
372 ms |
4296 KB |
Wrong Answer: Query(58, 987) - expected : 20022464, actual : 521277386. |
9 |
Incorrect |
373 ms |
4312 KB |
Wrong Answer: Query(33, 967) - expected : 676869696, actual : 1119256918. |
10 |
Incorrect |
374 ms |
4348 KB |
Wrong Answer: Query(116, 961) - expected : 68487362, actual : 2080976420. |