답안 #223006

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
223006 2020-04-14T13:32:57 Z aggu_01000101 비밀 (JOI14_secret) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "secret.h"
#define int long long
#define mid(l, u) ((l+u)/2)
#define lchild(i) (i*2 + 1)
#define rchild(i) (i*2 + 2)
using namespace std;
int DP[1000][1000];
int segtree[4000];
int N;
int build(int l, int u, int i, int a[]){
    if(l==u) return segtree[i] = a[l];
    return segtree[i] = Secret(build(l, mid(l, u), lchild(i), a), build(mid(l, u)+1, u, rchild(i), a));
}
int query(int l, int u, int i, int ll, int uu){
    if(l>=ll && u<=uu) return segtree[i];
    if(l>mid(l, u)) return query(mid(l, u)+1, u, rchild(i), ll, uu);
    if(u<=mid(l, u)) return query(l, mid(l, u), lchild(i), ll, uu);
    return Secret(query(l, mid(l, u), lchild(i), ll, mid(l, u)), query(mid(l, u)+1, u, rchild(i), mid(l, u)+1, uu));
}
void Init(int n, int a[]){
    N = n;
    for(int i = 0;i<n;i++){
        for(int j = 0;j<n;j++) DP[i][j] = -1;
    }
    build(0, n-1, 0, a);
}
int Query(int L, int R){
    return query(0, N-1, 0, L, R);
}
//-2 4 5 5 6 8
//8 -2 6 4 5 5
//5 5 4 6 -2 8

Compilation message

/tmp/ccfPnOmE.o: In function `main':
grader-full.cpp:(.text.startup+0x27b): undefined reference to `Init(int, int*)'
grader-full.cpp:(.text.startup+0x2d3): undefined reference to `Query(int, int)'
collect2: error: ld returned 1 exit status