Submission #542662

# Submission time Handle Problem Language Result Execution time Memory
542662 2022-03-27T13:05:17 Z __Variatto Secret (JOI14_secret) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "secret.h"
using namespace std;
#define pb push_back
#define fi first
#define se second
#define ll long long
const ll MAX=1e3+10, L=10;
ll n, daq[MAX][L+2], q, a, b, t[MAX], pot;
/*ll Secret(ll a, ll b){
    return a*b;
}
*/int Query(ll l, ll r){
    if(l==r) return t[l];
    ll x=32-__builtin_clz(l^r);
    return Secret(daq[l][x], daq[r][x]);
}
void rek(ll pocz, ll kon, ll nr){
    if(pocz==kon){
        daq[pocz][nr]=t[pocz];
        return;
    }
    ll sr=(pocz+kon)/2;
    daq[sr][nr]=t[sr];
    for(ll i=sr-1; i>=pocz; i--)
        daq[i][nr]=Secret(t[i], daq[i+1][nr]);
    if(sr+1<=kon)
        daq[sr+1][nr]=t[sr+1];
    for(ll i=sr+2; i<=kon; i++)
        daq[i][nr]=Secret(daq[i-1][nr], t[i]);
    rek(pocz, sr, nr-1);
    rek(sr+1, kon, nr-1);
}
void Init(ll N, ll A[]){
    n=N;
    for(ll i=0; i<n; i++)
        t[i]=A[i];
    while((1<<pot)<n) pot++;
    rek(0, n-1, pot);
}
/*ll main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    ll n1;
    cin>>n1;
    ll A1[n1];
    for(ll i=0; i<n1; i++) cin>>A1[i];
    Init(n1, A1);
    ll q1;
    cin>>q1;
    while(q1--){
        ll a, b;
        cin>>a>>b;
        cout<<Query(a, b)<<"\n";
    }
}
*/

Compilation message

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