#include "secret.h"
#include <bits/stdc++.h>
using namespace std;
int D[1001][1001],NN;
int process(int L, int R)
{
int M = (L+R)/2;
return D[L][R] = Secret(D[L][M],D[M+1][R]);
}
void Init(int N, int A[]) {
for(int i=0; i<N; i++) D[i][i] = A[i];
NN = N;
for(int i=0; i<N; i++){
for(int j=i+1; j<N; j++){
D[i][j] = Secret(D[i][j-1],D[j][j]);
}
}
}
int getans(int S, int E, int L, int R)
{
if(L<=S && E<=R) return D[S][E];
int M = (S+E)/2, P=-1, Q=-1;
if(M>=L) P = getans(S,M,L,R);
if(M+1<=R) Q = getans(M+1,E,L,R);
if(P==-1) return Q;
if(Q==-1) return P;
return Secret(P,Q);
}
int Query(int L, int R) {
return getans(0,NN-1,L,R);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
311 ms |
4472 KB |
Output isn't correct - number of calls to Secret by Init = 130305, maximum number of calls to Secret by Query = 13 |
2 |
Incorrect |
316 ms |
4380 KB |
Output isn't correct - number of calls to Secret by Init = 130816, maximum number of calls to Secret by Query = 14 |
3 |
Incorrect |
315 ms |
4472 KB |
Output isn't correct - number of calls to Secret by Init = 131328, maximum number of calls to Secret by Query = 15 |
4 |
Incorrect |
1038 ms |
8312 KB |
Output isn't correct - number of calls to Secret by Init = 498501, maximum number of calls to Secret by Query = 15 |
5 |
Incorrect |
1028 ms |
8360 KB |
Output isn't correct - number of calls to Secret by Init = 499500, maximum number of calls to Secret by Query = 15 |
6 |
Incorrect |
986 ms |
8456 KB |
Output isn't correct - number of calls to Secret by Init = 499500, maximum number of calls to Secret by Query = 4 |
7 |
Incorrect |
1056 ms |
8264 KB |
Output isn't correct - number of calls to Secret by Init = 499500, maximum number of calls to Secret by Query = 16 |
8 |
Incorrect |
1056 ms |
8312 KB |
Output isn't correct - number of calls to Secret by Init = 499500, maximum number of calls to Secret by Query = 16 |
9 |
Incorrect |
1057 ms |
8312 KB |
Output isn't correct - number of calls to Secret by Init = 499500, maximum number of calls to Secret by Query = 16 |
10 |
Incorrect |
1063 ms |
8288 KB |
Output isn't correct - number of calls to Secret by Init = 499500, maximum number of calls to Secret by Query = 16 |