#include "secret.h"
using namespace std;
int seg[4000],n,arr[1000],cnt=0;
void update(int idx=0,int l=0,int r = n-1){
if(l == r){
seg[idx] = arr[l];
return;
}
int mid = (l+r)>>1;
update(idx>>1,mid+1,r);
update(idx>>1|1,l,mid);
seg[idx] = Secret(seg[idx>>1], seg[idx>>1|1]);
}
int query(int L,int R,int idx=0,int l=0,int r=n-1){
if(l >= L && r <= R)return seg[idx];
if(r < L || l > R)return -1;
int mid = (l+r)>>1;
int first = query(L,R,idx>>1,mid+1,r);
int second = query(L,R,idx>>1|1,l,mid);
if(first != -1 && second != -1){
cnt++;
return Secret(first,second);
}
else if(first != -1)
return first;
else if(second != -1)
return second;
else return -1;
}
void init(int N,int A[]){
n = N;
for(int i=0;i<n;i++)arr[i] = A[i];
update();
}
int Query(int l,int r){
return query(l,r);
}
Compilation message
/usr/bin/ld: /tmp/ccMXJwbA.o: in function `main':
grader-full.cpp:(.text.startup+0x2a8): undefined reference to `Init(int, int*)'
collect2: error: ld returned 1 exit status