제출 #296901

#제출 시각아이디문제언어결과실행 시간메모리
296901Dovran커다란 상품 (IOI17_prize)C++11
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> //#include "prize.h" #define N 300009 #define pii pair <int, int> #define ff first #define ss second #define pb push_back #define ll long long using namespace std; /* vector<int> ask(int x){ int a, b; cin>>a>>b; vector<int>e; e.pb(a), e.pb(b); return e; } */ int find_best(int n){ int l=0, r=n-1; int ans=0; while(l<=r){ int md=(l+r)/2; vector<int>e=ask(md); if(e[0]+e[1]>1){ ans=3; break; } if(e[0]==0 and e[1]==0){ ans=md; break; } if(e[0]>0) r=md-1; else l=md+1; } return ans; } /* int main(){ int n; cin>>n; cout<<find_best(n); }*/

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

prize.cpp: In function 'int find_best(int)':
prize.cpp:26:16: error: 'ask' was not declared in this scope
   26 |   vector<int>e=ask(md);
      |                ^~~