Submission #227970

#TimeUsernameProblemLanguageResultExecution timeMemory
227970AaronNaiduThe Big Prize (IOI17_prize)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "prize.h" using namespace std; int find_best(int n) { int minn = 0; int maxx = n-1; while (minn <= maxx) { int med = (min + max)/2; vector<int> v = ask(med); if (ask = {0, 0}) { return 0; } if (ask = {0, 1}) { min = med + 1; } else { max = med - 1; } } return minn; }

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:11:24: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator+'
         int med = (min + max)/2;
                    ~~~~^~~~~
prize.cpp:13:24: error: assignment of function 'std::vector<int> ask(int)'
         if (ask = {0, 0})
                        ^
prize.cpp:13:24: error: cannot convert '<brace-enclosed initializer list>' to 'std::vector<int>(int)' in assignment
prize.cpp:17:24: error: assignment of function 'std::vector<int> ask(int)'
         if (ask = {0, 1})
                        ^
prize.cpp:17:24: error: cannot convert '<brace-enclosed initializer list>' to 'std::vector<int>(int)' in assignment
prize.cpp:19:25: error: overloaded function with no contextual type information
             min = med + 1;
                         ^
prize.cpp:23:25: error: overloaded function with no contextual type information
             max = med - 1;
                         ^