Submission #422913

#TimeUsernameProblemLanguageResultExecution timeMemory
422913albertolg101The Big Prize (IOI17_prize)C++17
20 / 100
1 ms324 KiB
#include <bits/stdc++.h>
#include "prize.h"

using namespace std; 

int find_best(int n) {

	vector<int> ar = ask(0);

	if(ar[1] == 0)
		return 0;

	int pos = 0;

	for(int i = 17 ; i >= 0 ; i--)
	{
		int target = pos + (1<<i);
		if(target < n and ask(target)[1] == 1)
			pos = target ;
	}

	return pos + 1;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...