답안 #438826

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
438826 2021-06-28T17:14:45 Z fadi57 비밀 (JOI14_secret) C++14
0 / 100
535 ms 4368 KB
#include "secret.h"
//#include "grader.cpp"
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
const int mx=1019;
typedef long long ll;
const int mod=1e9+7;
int inf=1e9+10;
int arr[mx];
int n;
int seg[4*mx];
int merg(int x,int y){

if(x==-1){return y;}
if(y==-1){return x;}

return Secret(x,y);




}
void solve(int node,int l,int r){

         if(l==r){

            seg[node]=arr[l];
            return ;
         }
      int mid=(l+r)/2;

      solve(node*2,l,mid);solve(node*2+1,mid+1,r);
       seg[node]=merg(seg[node*2],seg[node*2+1]);
       return;

 }

 int query (int node,int l,int r,int l2,int r2){

       if(l>r2||r<l2){

        return -1;
       }

     if(l>=l2&&r<=r2){
        return seg[node];
     }
     int mid=(l+r)/2;

 return merg(query(node*2,l,mid,l2,r2),query(node*2+1,mid+1,r,l2,r2));

 }
void Init(int N, int A[]) {

    for(int i=0;i<N;i++){
        cin>>arr[i];
    }
    n=N;
 // Secret(0, 1000000000);

 solve(1,0,n-1);
}

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

# 결과 실행 시간 메모리 Grader output
1 Incorrect 132 ms 2372 KB Wrong Answer: Query(222, 254) - expected : 34031541, actual : 536870912.
2 Incorrect 134 ms 2432 KB Wrong Answer: Query(60, 375) - expected : 669221184, actual : 0.
3 Incorrect 137 ms 2376 KB Wrong Answer: Query(211, 401) - expected : 674373968, actual : 536870912.
4 Incorrect 514 ms 4164 KB Wrong Answer: Query(90, 497) - expected : 397934825, actual : 536870912.
5 Incorrect 520 ms 4368 KB Wrong Answer: Query(587, 915) - expected : 752404486, actual : 536870912.
6 Incorrect 509 ms 4340 KB Wrong Answer: Query(915, 915) - expected : 282904741, actual : 0.
7 Incorrect 518 ms 4344 KB Wrong Answer: Query(84, 976) - expected : 742463504, actual : 0.
8 Incorrect 508 ms 4208 KB Wrong Answer: Query(58, 987) - expected : 20022464, actual : 536870912.
9 Incorrect 535 ms 4304 KB Wrong Answer: Query(33, 967) - expected : 676869696, actual : 0.
10 Incorrect 509 ms 4228 KB Wrong Answer: Query(116, 961) - expected : 68487362, actual : 0.