#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MAX = 1015;
const int LOG = 25;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
#define pb push_back
#define sz(x) (int) x.size()
#define fr first
#define sc second
#define mp make_pair
#define all(x) x.begin(), x.end()
#define dbg(x) cout << #x << ": " << "[ " << x << " ]\n"
string s, ans[MAX][LOG];
void init(int n, string S){
for(int i = 0; i < n; i++)
s += S[i], ans[i][0] = S[i];
int log = log2(n) + 1;
for(int j = 1; j < log; j++){
for(int i = 0; i < n; i++){
ans[i][j] = ans[i][j - 1];
if(i + (1 << j) >= n) continue;
for(int k = 0; k < sz(ans[i][j - 1]); k++){
ans[i][j] += ans[i][j - 1][k];
ans[i][j] += ans[i + (1 << (j - 1))][j - 1][k];
}
}
}
}
int query(int I, int K){
string aux = s.substr(I, (1 << K));
return aux == ans[I][K];
}
Compilation message
/usr/bin/ld: /tmp/ccLVBiPf.o: in function `main':
grader.cpp:(.text.startup+0x72): undefined reference to `init(int, char const*)'
collect2: error: ld returned 1 exit status