Submission #738597

# Submission time Handle Problem Language Result Execution time Memory
738597 2023-05-09T07:04:32 Z MEGalodon Secret (JOI14_secret) C++14
Compilation error
0 ms 0 KB
#include "secret.h"
#define MAXN 1001

int dat[MAXN][12];
int mask[MAXN];
void divi(int l, int r, int lev, int A[]){ //zero indexed
    if( l == r ){ dat[l][11] = A[l]; return; }
    int m = (l+r)/2;
    dat[m][lev] = A[m];
    dat[m+1][lev] = A[m+1]; //makes a difference in this case
    for( int i{m-1} ; i >= l ; --i ) dat[i][lev] = Secret(A[i], dat[i+1][lev]);
    for( int i{m+2} ; i <= r ; ++i ) dat[i][lev] = Secret(dat[i-1][lev], A[i]);
    for( int i{m+1} ; i <= r ; ++i ) mask[i] ^= (1<<lev);
    divi(l, m, lev+1, A);
    divi(m+1, r, lev+1, A);
}
void Init(int N, int A[]) {
    divi(0, N-1, 0, A);
    return;
}

Compilation message

/usr/bin/ld: /tmp/ccIiMpTo.o: in function `main':
grader-full.cpp:(.text.startup+0x30b): undefined reference to `Query(int, int)'
collect2: error: ld returned 1 exit status