#include <cstdio>
#include "secret.h"
using namespace std;
typedef long long LL;
int n, a[1005], tree[4005];
void start(int si, int ei, int ind)
{
if (si==ei) {
tree[ind] = a[si];
return;
}
int mi=(si+ei)>>1;
start(si, mi, ind<<1);
start(mi+1, ei, ind<<1|1);
tree[ind] = Secret(tree[ind<<1], tree[ind<<1|1]);
}
void init(int N, int A[])
{
int i;
n = N;
for (i=1; i<=n; i++) a[i]=A[i-1];
start(1, n, 1);
}
int get_ans(int si, int ei, int s, int e, int ind)
{
if (si>e||ei<s) return -1;
if (si>=s&&ei<=e) return tree[ind];
int mi = (si+ei)>>1, l, r;
l = get_ans(si, mi, s, e, ind<<1);
r = get_ans(mi+1, ei, s, e, ind<<1|1);
if (l<0&&r<0) return -1;
if (l<0) return r;
if (r<0) return l;
return Secret(l, r);
}
int Query(int L, int R)
{
return get_ans(1, n, L+1, R+1, 1);
}
Compilation message
/tmp/cceOSAHa.o: In function `main':
grader-full.cpp:(.text.startup+0x27b): undefined reference to `Init(int, int*)'
collect2: error: ld returned 1 exit status