답안 #438825

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
438825 2021-06-28T17:12:20 Z fadi57 비밀 (JOI14_secret) C++14
0 / 100
542 ms 4476 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 arr[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 133 ms 2492 KB Wrong Answer: Query(222, 254) - expected : 34031541, actual : 536870912.
2 Incorrect 134 ms 2384 KB Wrong Answer: Query(60, 375) - expected : 669221184, actual : 0.
3 Incorrect 134 ms 2340 KB Wrong Answer: Query(211, 401) - expected : 674373968, actual : 536870912.
4 Incorrect 511 ms 4388 KB Wrong Answer: Query(90, 497) - expected : 397934825, actual : 536870912.
5 Incorrect 504 ms 4332 KB Wrong Answer: Query(587, 915) - expected : 752404486, actual : 536870912.
6 Incorrect 505 ms 4364 KB Wrong Answer: Query(915, 915) - expected : 282904741, actual : 0.
7 Incorrect 529 ms 4292 KB Wrong Answer: Query(84, 976) - expected : 742463504, actual : 0.
8 Incorrect 542 ms 4348 KB Wrong Answer: Query(58, 987) - expected : 20022464, actual : 536870920.
9 Incorrect 507 ms 4264 KB Wrong Answer: Query(33, 967) - expected : 676869696, actual : 0.
10 Incorrect 510 ms 4476 KB Wrong Answer: Query(116, 961) - expected : 68487362, actual : 0.