제출 #288973

#제출 시각아이디문제언어결과실행 시간메모리
288973Touubs커다란 상품 (IOI17_prize)C++17
20 / 100
1 ms512 KiB
#include "prize.h"

int find_best(int n) {
    int min = 0;
    int max = n;

    while (min + 1 < max) {
	int mid = (min + max) / 2;
	if (ask(mid)[0] == 0) min = mid;
	else max = mid;
    }
    return min;

	for(int i = 0; i < n; i++) {
		std::vector<int> res = ask(i);
		if(res[0] + res[1] == 0)
			return i;
	}
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...