제출 #1203865

#제출 시각아이디문제언어결과실행 시간메모리
1203865nikolashamiThe Big Prize (IOI17_prize)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; using ll=long long; const ll L=500; int find_best(int n){ map<ll,ll>C; for(int i=0;i<L;++i){ vector<int>a=ask(i); ++C[a[0]+a[1]]; if(!a[0]&&!a[1])return i; } ll x=0,lik=L-1,br,l,r; for(auto[u,v]:C)x=max(x,u); br=L-C[x]; while(1){ l=lik+1,r=n-1; while(l<=r){ ll m=(l+r)/2; vector<int>a=ask(m); if(!a[0]&&!a[1])return i; else if(a[0]+a[1]==x){ if(a[0]!=br)r=m-1; else l=m+1; }else{ x=m; r=m-1; } } ++br; } return -1; }

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

prize.cpp: In function 'int find_best(int)':
prize.cpp:10:30: error: 'ask' was not declared in this scope
   10 |                 vector<int>a=ask(i);
      |                              ^~~
prize.cpp:21:38: error: 'ask' was not declared in this scope
   21 |                         vector<int>a=ask(m);
      |                                      ^~~
prize.cpp:22:48: error: 'i' was not declared in this scope
   22 |                         if(!a[0]&&!a[1])return i;
      |                                                ^