Submission #599123

#TimeUsernameProblemLanguageResultExecution timeMemory
599123pakhomoveeThe Big Prize (IOI17_prize)C++17
Compilation error
0 ms0 KiB
#include "prize.h"

int find_best(int n) {
    int pr = 0;
    int have = 0;
    for (int i = 0; i < 400; ++i) {
        int l = pr, r = n;
        while (l + 1 < r) {
            int m = (l + r) / 2;
            if (ask(m)[0] - have) {
                r = m;
            } else {
                l = m;
            }
        }
        vector<int> arr = ask(l);
        if (arr[0] == arr[1] && arr[0] == 0) {
            return l;
        }
        pr = l + 1;
        ++have;
    }
    return -1;
}

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:16:9: error: 'vector' was not declared in this scope
   16 |         vector<int> arr = ask(l);
      |         ^~~~~~
prize.cpp:16:9: note: suggested alternatives:
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'
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
In file included from prize.h:1,
                 from prize.cpp:1:
/usr/include/c++/10/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
prize.cpp:16:16: error: expected primary-expression before 'int'
   16 |         vector<int> arr = ask(l);
      |                ^~~
prize.cpp:17:13: error: 'arr' was not declared in this scope
   17 |         if (arr[0] == arr[1] && arr[0] == 0) {
      |             ^~~