답안 #803739

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
803739 2023-08-03T05:44:21 Z 8pete8 비밀 (JOI14_secret) C++14
컴파일 오류
0 ms 0 KB
#include<iostream>
#include<stack>
#include<map>
#include<vector>
#include<string>
#include<unordered_map>
#include <queue>
#include<cstring>
#include<limits.h>
#include<cmath>
#include<set>
#include<algorithm>
#include<bitset>
using namespace std;
#define ll long long
#define f first
#define endl "\n"
#define s second
#define pii pair<int,int>
#define ppii pair<pii,int>
#define pb push_back
#define mp make_pair
#define fastio ios::sync_with_stdio(false);cin.tie(NULL);
#define int long long
const int mxn=1e3;
int ans[11][mxn+10];
int v[mxn+10],in[mxn+10];
void solve(int l,int r,int lev){
    if(l==r)return;
    int m=l+(r-l)/2;
    ans[lev][m]=v[m];
    for(int i=m-1;i>=l;i--)ans[lev][i]=min(v[i],ans[lev][i+1]);
    ans[lev][m+1]=v[m+1];
    for(int i=m+2;i<=r;i++)ans[lev][i]=min(v[i],ans[lev][i-1]);
    for(int i=m+1;i<=r;i++)in[i]^=(1LL<<lev);
    solve(l,m,lev+1);
    solve(m+1,r,lev+1);
}
void Init(int N,int A[]){
    for(int i=0;i<N;i++)v[i]=A[i];
    solve(0,N-1,0);
}
int Query(int L,int R){
    if(L==R)return v[L];
    int b=__builtin_ctz(in[L]^in[R]);
    return min(ans[b][L],ans[b][R]);
}

Compilation message

/usr/bin/ld: /tmp/cc9GVeoa.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