Submission #851845

# Submission time Handle Problem Language Result Execution time Memory
851845 2023-09-20T17:12:30 Z mareksb Secret (JOI14_secret) C++14
0 / 100
448 ms 4388 KB
#include "secret.h"
#include <bits/stdc++.h>

using namespace std;
int num_of_elements = 0;
int coefs[1000];
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 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 97 ms 2732 KB Wrong Answer: Query(222, 254) - expected : 34031541, actual : 1395990149.
2 Incorrect 99 ms 2728 KB Wrong Answer: Query(60, 375) - expected : 669221184, actual : 1051128059.
3 Incorrect 104 ms 2732 KB Wrong Answer: Query(211, 401) - expected : 674373968, actual : -1941911076.
4 Incorrect 372 ms 4268 KB Wrong Answer: Query(90, 497) - expected : 397934825, actual : -1931764879.
5 Incorrect 368 ms 4388 KB Wrong Answer: Query(587, 915) - expected : 752404486, actual : -922515955.
6 Incorrect 373 ms 4184 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 384 ms 4264 KB Wrong Answer: Query(58, 987) - expected : 20022464, actual : 521277386.
9 Incorrect 370 ms 4324 KB Wrong Answer: Query(33, 967) - expected : 676869696, actual : 1119256918.
10 Incorrect 448 ms 4284 KB Wrong Answer: Query(116, 961) - expected : 68487362, actual : 2080976420.