제출 #131444

#제출 시각아이디문제언어결과실행 시간메모리
13144420160161simone커다란 상품 (IOI17_prize)C++14
컴파일 에러
0 ms0 KiB
#include "prize.h" int find_best(int n) { int l=0,r=n-1; while(0==0) { int mid=(l+r)/2; vector<int> q=ask(mid); if(q[0]==0&&q[1]==0) { return mid+1; } else { if(q[0]==1) { r=mid; } else l=mid; } } }

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

prize.cpp: In function 'int find_best(int)':
prize.cpp:8:3: error: 'vector' was not declared in this scope
   vector<int> q=ask(mid);
   ^~~~~~
prize.cpp:8:3: note: suggested alternative:
In file included from /usr/include/c++/7/vector:64:0,
                 from prize.h:1,
                 from prize.cpp:1:
/usr/include/c++/7/bits/stl_vector.h:216:11: note:   'std::vector'
     class vector : protected _Vector_base<_Tp, _Alloc>
           ^~~~~~
prize.cpp:8:10: error: expected primary-expression before 'int'
   vector<int> q=ask(mid);
          ^~~
prize.cpp:9:6: error: 'q' was not declared in this scope
   if(q[0]==0&&q[1]==0)
      ^