Submission #150983

# Submission time Handle Problem Language Result Execution time Memory
150983 2019-09-01T13:55:42 Z osaaateiasavtnl Secret (JOI14_secret) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include "secret.h"
using namespace std;
#define int long long 
#define ii pair <int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcount
#define ll long long
#define mp make_pair
#define f first
#define s second
const int N = 1001;
int mem[N][N], memn;
void prec(int l, int r) {
    if (l == r) return;
    int m = (l + r) >> 1;
    prec(l, m); prec(m + 1, r);
    for (int i = m - 1; i >= l; --i) mem[i][m] = Secret(mem[i][i], mem[i + 1][m]);
    for (int i = m + 2; i <= r; ++i) mem[m][i] = Secret(mem[m + 1][i - 1], mem[i][i]);
}   
void Init(int n, int a[]) {
    for (int i = 1; i <= n; ++i) mem[i][i] = a[i];
    prec(1, n);
    memn = n;
}   
int get(int tl, int tr, int l, int r) {
    if (tl == tr) return mem[tl][tl];
    int tm = (tl + tr) >> 1;
    if (r <= tm) return get(tl, tm, l, r);
    if (tm < l) return get(tm + 1, tr, l, r);
    return Secret(mem[l][tm], mem[tm + 1][r]);
}   
int Query(int l, int r) { return get(1, memn, l, r); }

Compilation message

/tmp/ccRFAzw8.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