#include "secret.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1005;
const ll MOD = 1000000007;
// const ll MOD = 998244353;
const ll BFN = (ll)1e16;
// const int BFN = (int)1e8;
int n;
int a[MAXN];
int ans[20][MAXN];
void F(int lv, int l, int r) {
if(l == r) {
ans[lv][l] = a[l];
return;
}
int m = (l + r) / 2;
ans[lv][m] = a[m];
for(int i = m-1; i >= l; i--) {
ans[lv][i] = Secret(a[i], ans[lv][i+1]);
}
ans[lv][m+1] = a[m+1];
for(int i = m+2; i <= r; i++) {
ans[lv][i] = Secret(ans[lv][i-1], a[i]);
}
F(lv+1, l, m);
F(lv+1, m+1, r);
}
int G(int lv, int l, int r, int ql, int qr) {
int m = (l+r)/2;
if(qr <= m) {
return G(lv+1, l, m, ql, qr);
}
if(m+1 <= ql) {
return G(lv+1, m+1, r, ql, qr);
}
return Secret(ans[lv][ql], ans[lv][qr]);
}
void Init(int N, int A[]) {
n = N;
for(int i = 1; i <= n; i++) a[i] = A[i-1];
F(1, 1, n);
}
int Query(int L, int R) {
if(L == R) return a[L];
return G(1, 1, n, L, R);
}
Compilation message
secret.cpp:7:7: error: 'll' does not name a type
7 | const ll MOD = 1000000007;
| ^~
secret.cpp:9:7: error: 'll' does not name a type
9 | const ll BFN = (ll)1e16;
| ^~