#include <bits/stdc++.h>
#include "secret.h"
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;
#define f(i,a,b) for(int i = a; i < b; i++)
#define fa(i,a,b) for(int i = a; i >= b; i--)
#define ff first
#define ss second
const int N = 1005;
const ll inf = 1e17 + 100;
int n, a[N], L[N][N], R[N][N];
void go(int l, int r){
if(l == r){
L[l][l] = R[l][l] = a[l];
return ;
}
int m = (l+r)>>1;
L[m][m] = a[m];
fa(i,m-1,l) L[m][i] = Secret(a[i], L[m][i+1]);
R[m+1][m+1] = a[m+1];
f(i,m+2,r+1) R[m+1][i] = Secret(R[m+1][i-1], a[i]);
go(l, m), go(m+1, r);
}
void Init(int ni, vector <int> x){
n = ni;
f(i,0,n) a[i] = x[i];
go(0, n-1);
}
int Query(int x, int y){
int l = 0, r = n-1;
while(1){
int m = (l+r)>>1;
if(y == m)
return L[y][x];
if(x == m+1)
return R[x][y];
if(x <= m and m+1 <= y)
return Secret(L[m][x], R[m+1][y]);
if(y < m) r = m;
else l = m+1;
}
return -1;
}
Compilation message
/usr/bin/ld: /tmp/ccckgDek.o: in function `main':
grader-full.cpp:(.text.startup+0x2a8): undefined reference to `Init(int, int*)'
collect2: error: ld returned 1 exit status