Submission #434233

#TimeUsernameProblemLanguageResultExecution timeMemory
434233AmineTrabelsiThe Big Prize (IOI17_prize)C++14
0 / 100
1 ms324 KiB
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;

int find_best(int n) {
	// 20 points:
	// 1 diamond
	int low = 0,high = n-1;
	int ans = 0;
	while(low != high){
		int mid = (low+high)/2;
		vector<int> q = ask(mid);
		if(q[0]+q[1] == 0){
			ans = mid;
			break;
		}
		if(q[0] == 1){
			high = mid-1;
		}else{
			low = mid+1;
		}
	}
	return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...