제출 #227970

#제출 시각아이디문제언어결과실행 시간메모리
227970AaronNaiduThe Big Prize (IOI17_prize)C++14
컴파일 에러
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;
}

컴파일 시 표준 에러 (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;
                         ^