제출 #743651

#제출 시각아이디문제언어결과실행 시간메모리
743651sword060Xylophone (JOI18_xylophone)C++17
컴파일 에러
0 ms0 KiB
#include "xylophone.h" #include <bits/stdc++.h> using namespace std; void solve(int x){ int l=3,r=x,mid,bst=2; while(l<=r){ mid=(l+r)/2; if(query(1,mid)==x-1)r=mid-1,bst=mid; else l=mid+1; } answer(bst,x); int lst=x; for(int i=bst+1;bst<=x;bst++){ lst=qry(i-1,i); answer(i,lst); } lst=bst; for(int i=bst-1;i>=1;i--){ lst=qry(i,i+1); answer(i,lst); } }

컴파일 시 표준 에러 (stderr) 메시지

xylophone.cpp: In function 'void solve(int)':
xylophone.cpp:14:7: error: 'qry' was not declared in this scope; did you mean 'query'?
   14 |   lst=qry(i-1,i);
      |       ^~~
      |       query
xylophone.cpp:19:7: error: 'qry' was not declared in this scope; did you mean 'query'?
   19 |   lst=qry(i,i+1);
      |       ^~~
      |       query