Submission #316068

#TimeUsernameProblemLanguageResultExecution timeMemory
316068MrDominoThe Big Prize (IOI17_prize)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "prize.h" int find_best(int n) { /// subtask 1 int l = 0, r = n - 1; while (l <= r) { int m = (l + r) / 2; vector<int> v = ask(m); if (v[0] == 0 && v[1] == 0) { return i; } if (v[0] == 1) { r = m - 1; } else { l = m + 1; } } assert(0); }

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:9:5: error: 'vector' was not declared in this scope; did you mean 'std::vector'?
    9 |     vector<int> v = ask(m);
      |     ^~~~~~
      |     std::vector
In file included from /usr/include/c++/9/vector:67,
                 from /usr/include/c++/9/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:86,
                 from prize.cpp:1:
/usr/include/c++/9/bits/stl_vector.h:386:11: note: 'std::vector' declared here
  386 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
prize.cpp:9:12: error: expected primary-expression before 'int'
    9 |     vector<int> v = ask(m);
      |            ^~~
prize.cpp:10:9: error: 'v' was not declared in this scope
   10 |     if (v[0] == 0 && v[1] == 0) {
      |         ^
prize.cpp:11:14: error: 'i' was not declared in this scope
   11 |       return i;
      |              ^
prize.cpp:13:9: error: 'v' was not declared in this scope
   13 |     if (v[0] == 1) {
      |         ^