답안 #487201

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
487201 2021-11-14T19:18:39 Z AnasBenMoussa 비밀 (JOI14_secret) C++14
0 / 100
432 ms 4292 KB
#include <bits/stdc++.h>
#include "secret.h"

using namespace std;
long long  a[10000];
int tree[400000];int n;
void build(int v, int tl, int tr) {
    if (tl == tr) {
        tree[v] = a[tl];
    } else {
        int tm = (tl + tr) / 2;
        build( v*2, tl, tm);
        build( v*2+1, tm+1, tr);
        tree[v] = Secret(tree[v*2],tree[v*2+1]);
    }
}
void Init(int N, int A[]){
    n=N;
   for(long long  i=0;i<N;i++){
        a[i]=A[i];
   }
   build(0,0,N-1);
}
int sum(int v, int tl, int tr, int l, int r) {
    if (l > r) 
        return 0;
    if (l == tl && r == tr) {
        return tree[v];
    }
    int tm = (tl + tr) / 2;
    return Secret(sum(v*2, tl, tm, l, min(r, tm))
            ,sum(v*2+1, tm+1, tr, max(l, tm+1), r));
}


int  Query(int L , int R){
    
    return sum(0,0,n-1,L,R);
}


# 결과 실행 시간 메모리 Grader output
1 Incorrect 116 ms 2260 KB Wrong Answer: Query(222, 254) - expected : 34031541, actual : 307592051.
2 Incorrect 114 ms 2284 KB Wrong Answer: Query(60, 375) - expected : 669221184, actual : 922431905.
3 Incorrect 110 ms 2376 KB Wrong Answer: Query(211, 401) - expected : 674373968, actual : 87513210.
4 Incorrect 426 ms 4276 KB Wrong Answer: Query(90, 497) - expected : 397934825, actual : 546325106.
5 Incorrect 410 ms 4288 KB Wrong Answer: Query(263, 292) - expected : 653448456, actual : 15892812.
6 Incorrect 416 ms 4236 KB Wrong Answer: Query(915, 915) - expected : 282904741, actual : 278446241.
7 Incorrect 431 ms 4188 KB Wrong Answer: Query(84, 976) - expected : 742463504, actual : 215581720.
8 Incorrect 432 ms 4228 KB Wrong Answer: Query(58, 987) - expected : 20022464, actual : 336853080.
9 Incorrect 412 ms 4292 KB Wrong Answer: Query(33, 967) - expected : 676869696, actual : 818818691.
10 Incorrect 421 ms 4220 KB Wrong Answer: Query(116, 961) - expected : 68487362, actual : 880675712.