답안 #487206

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

using namespace std;
long long  a[10000];
int tree[400000];int n;
int mer(int a,int b){

    if(a==INT_MIN){return b;}
    if(b==INT_MIN){return a;}

    return Secret(a,b);




}
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] = mer(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 INT_MIN ;
    if (l == tl && r == tr) {
        return tree[v];
    }
    int tm = (tl + tr) / 2;
    return mer(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 2316 KB Wrong Answer: Query(222, 254) - expected : 34031541, actual : 315980659.
2 Incorrect 112 ms 2380 KB Wrong Answer: Query(60, 375) - expected : 669221184, actual : 922431905.
3 Incorrect 117 ms 2372 KB Wrong Answer: Query(211, 401) - expected : 674373968, actual : 87513210.
4 Incorrect 422 ms 4180 KB Wrong Answer: Query(90, 497) - expected : 397934825, actual : 546325106.
5 Incorrect 425 ms 4292 KB Wrong Answer: Query(263, 292) - expected : 653448456, actual : 15892812.
6 Incorrect 409 ms 4272 KB Wrong Answer: Query(200, 208) - expected : 277813445, actual : 549079216.
7 Incorrect 456 ms 4296 KB Wrong Answer: Query(84, 976) - expected : 742463504, actual : 215581720.
8 Incorrect 411 ms 4292 KB Wrong Answer: Query(58, 987) - expected : 20022464, actual : 336853080.
9 Incorrect 450 ms 4272 KB Wrong Answer: Query(33, 967) - expected : 676869696, actual : 818818691.
10 Incorrect 422 ms 4348 KB Wrong Answer: Query(116, 961) - expected : 68487362, actual : 880675712.