답안 #276579

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
276579 2020-08-20T14:00:04 Z super_j6 popa (BOI18_popa) C++14
컴파일 오류
0 ms 0 KB
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <stack>
using namespace std;
#define endl '\n'
#define ll long long
#define pi pair<int, int>
#define f first
#define s second

stack<int> stk;

int qry(int x, int y){
	return query(x, x, min(x, y), max(x, y));
}

int solve(int n, int l[], int r[]){
	for(int i = 0; i < n; i++){
		l[i] = r[i] = -1;
		while(!stk.empty() && qry(i, stk.top())){
			l[i] = stk.top();
			stk.pop();
		}
		if(!stk.empty()){
			if(!qry(stk.top(), i)) return -1;
			r[stk.top()] = i;
		}
		stk.push(i);
	}
	return stk.top();
}

Compilation message

popa.cpp: In function 'int qry(int, int)':
popa.cpp:15:9: error: 'query' was not declared in this scope; did you mean 'qry'?
   15 |  return query(x, x, min(x, y), max(x, y));
      |         ^~~~~
      |         qry