Submission #781282

#TimeUsernameProblemLanguageResultExecution timeMemory
781282OrazBThe Big Prize (IOI17_prize)C++14
Compilation error
0 ms0 KiB
#include "prize.h" int find_best(int n) { int l = 0, r = n; while(l <= r){ int md = (l+r)/2; vector<int> a = ask(md); if (a[0] == a[1]) return md; if (a[0] > a[1]) r = md - 1; else l = md + 1; } }

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:7:3: error: 'vector' was not declared in this scope; did you mean 'std::vector'?
    7 |   vector<int> a = ask(md);
      |   ^~~~~~
      |   std::vector
In file included from /usr/include/c++/10/vector:67,
                 from prize.h:1,
                 from prize.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:389:11: note: 'std::vector' declared here
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
prize.cpp:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> a = ask(md);
      |          ^~~
prize.cpp:8:7: error: 'a' was not declared in this scope
    8 |   if (a[0] == a[1]) return md;
      |       ^
prize.cpp:9:7: error: 'a' was not declared in this scope
    9 |   if (a[0] > a[1]) r = md - 1;
      |       ^
prize.cpp:12:1: warning: control reaches end of non-void function [-Wreturn-type]
   12 | }
      | ^