답안 #73654

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
73654 2018-08-28T16:23:53 Z yusufake popa (BOI18_popa) C++11
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;

#define _ int v, int tl, int tr, int l, int r
#define tm (tl+tr >> 1)
#define sol v+v,tl,tm,l,r
#define sag v+v+1,tm+1,tr,l,r

#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define pp pair<int,int>

const int mod = 1e9 + 7;
const int N = 1e3 + 3;

int L[N],R[N];
int f(int l, int r, int *lef, int *rig){
    if(l > r) return -1;
    int i;
    for(i=l;i<=r;i++)
        if(L[i] < l && R[i] > r)
            break;
    lef[i] = f(l,i-1,lef,rig);
    rig[i] = f(i+1,r,lef,rig);
    return i;
}

int solve(int n, int *lef, int *rig){
    int i;
    stack < int > S;
    for(i=0;i<n;i++){
        for(; S.size() && query(S.top(),i,i,i) ;){
            R[ S.top() ] = i;
            S.pop();
        }
        L[i] = S.size() ? -1 : S.top();
        S.push(i);
    }
    for(; S.size() ;){
        R[ S.top() ] = n;
        S.pop();
    }
    return f(0,n-1,lef,rig);
}

Compilation message

popa.cpp: In function 'int solve(int, int*, int*)':
popa.cpp:34:27: error: 'query' was not declared in this scope
         for(; S.size() && query(S.top(),i,i,i) ;){
                           ^~~~~