답안 #53180

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
53180 2018-06-29T00:19:41 Z okaybody10 비밀 (JOI14_secret) C++
0 / 100
630 ms 8672 KB
#include <bits/stdc++.h>
#include "secret.h"
using namespace std;
int n,B[1006],ans[1006][1006];
void _init(int s,int e)
{
    int m=(s+e)/2;
    if(s==e){
        ans[m][m]=B[m];
        return;
    }
    ans[m][m]=B[m];
    ans[m+1][m+1]=B[m+1];
    for(int i=m-1;i>=s;i--) ans[i][m]=Secret(ans[i+1][m],B[i]);
    for(int i=m+2;i<=e;i++) ans[m+1][i]=Secret(ans[m+1][i-1],B[i]);
    _init(s,m);
    _init(m+1,e);
}
void Init(int N, int A[]) {
    n=N;
    for(int i=0; i<n; i++) B[i]=A[i];
    _init(0,n-1);
}
int solve(int l,int r,int s,int e)
{
    int m=(s+e)/2;
    if(l<=m && m+1<=r) return Secret(ans[l][m],ans[m+1][r]);
    if(r<=m) return solve(l,r,s,m);
    else return solve(l,r,m+1,e);
}
int Query(int l, int r) {
    if(l==r) return B[r];
    return solve(l,r,0,n-1);
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 162 ms 4344 KB Wrong Answer: Query(113, 206) - expected : 536899947, actual : 538256673.
2 Incorrect 167 ms 4708 KB Wrong Answer: Query(60, 375) - expected : 669221184, actual : 311474560.
3 Incorrect 174 ms 4796 KB Wrong Answer: Query(211, 401) - expected : 674373968, actual : 353554500.
4 Incorrect 562 ms 8444 KB Wrong Answer: Query(90, 497) - expected : 397934825, actual : 343081568.
5 Incorrect 564 ms 8600 KB Wrong Answer: Query(587, 915) - expected : 752404486, actual : 957013316.
6 Incorrect 563 ms 8600 KB Wrong Answer: Query(747, 749) - expected : 244228265, actual : 935077363.
7 Incorrect 579 ms 8600 KB Wrong Answer: Query(84, 976) - expected : 742463504, actual : 675449873.
8 Incorrect 630 ms 8600 KB Wrong Answer: Query(58, 987) - expected : 20022464, actual : 273091792.
9 Incorrect 597 ms 8600 KB Wrong Answer: Query(33, 967) - expected : 676869696, actual : 827853577.
10 Incorrect 586 ms 8672 KB Wrong Answer: Query(116, 961) - expected : 68487362, actual : 337854787.