Submission #301263

# Submission time Handle Problem Language Result Execution time Memory
301263 2020-09-17T19:13:57 Z aloo123 Secret (JOI14_secret) C++14
Compilation error
0 ms 0 KB
        #include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <ratio>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <climits>
#include "secret.h"
#define ll long long
#define ld long double
#define mp make_pair
#define pb push_back
#define in insert
#define vll vector<ll>
#define endl "\n"
#define pll pair<ll,ll>
#define f first
#define s second
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define int ll
#define sz(x) (ll)x.size()
#define all(x) (x.begin(),x.end())
using namespace std;

 
const ll INF = 1e12;
const ll M =(1e5+5); // TODO : change value as per problem
const ll MOD = 1e9+7;
int t[4*M];
int a[M];
int n;
int comb(int x,int y){
    return Secret(x,y);
}
void build(int v,int l,int r){
    if(l == r){
        t[v] = a[l];
    }
    else{
        int m = (l+r)>>1ll;
        build(v*2,l,m);
        build(v*2+1,m+1,r);
        t[v] = comb(t[v*2],t[v*2+1]);
    }
}
int query(int v,int l,int r,int st,int en){
    if(l > en || r < st) return 0;
    if(l >= st &&  r<= en) return t[v];
    int m  = (l+r)>>1ll;
    return comb(query(v*2,l,m,st,en),query(v*2+1,m+1,r,st,en));
}



void Init(int N,int A[]){
    n = N;
    for(int i = 0;i<n;i++){
        a[i+1] = A[i];
    }
    build(1,1,n);

}
int Query(int L, int R){
    return query(1,1,n,L,R);
}


// void solve(){
    
// }
// signed main(){
 
//     ios_base::sync_with_stdio(0);
//     cin.tie(NULL);
//      // freopen(".in","r",stdin);freopen(".out","w",stdout);
    
//      ll tt=1;   
//      // cin >> tt;
//     while(tt--){    
//         solve();
//     }    
// }

Compilation message

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