답안 #89996

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
89996 2018-12-19T15:30:14 Z nikolapesic2802 커다란 상품 (IOI17_prize) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
int find_best(int n) {
    int l=0,r=n-1;
    while(true)
    {
        int m=(l+r)>>1;
        vector<int> tr=ask(m);
        if(tr[0]==1)
        {
            r=m-1;
        }
        else
        {
            if(tr[1]==1)
            {
                l=m+1;
            }
            else
            {
                return m;
            }
        }
    }
	/*for(int i = 0; i < n; i++) {
		std::vector<int> res = ask(i);
		if(res[0] + res[1] == 0)
			return i;
	}
	return 0;*/
}

Compilation message

prize.cpp: In function 'int find_best(int)':
prize.cpp:8:24: error: 'ask' was not declared in this scope
         vector<int> tr=ask(m);
                        ^~~