제출 #287015

#제출 시각아이디문제언어결과실행 시간메모리
287015kshitij_sodani커다란 상품 (IOI17_prize)C++14
20 / 100
1 ms384 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define mp make_pair
#define pb push_back
#define a first 
#define b second

#include "prize.h"

int find_best(int n) {
	int low=0;
	int high=n-1;
	while(low<high-1){
		int mid=(low+high)/2;
		vector<int> res=ask(mid);
		if(res[0]>0){
			high=mid;
		}
		else{
			low=mid;
		}
	}
	vector<int> res=ask(high);
	if(res[0]==0){
		return high;
	}
	else{
		return low;
	}
	/*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...