Submission #422885

#TimeUsernameProblemLanguageResultExecution timeMemory
422885albertolg101The Big Prize (IOI17_prize)C++17
0 / 100
105 ms260 KiB
#include <bits/stdc++.h>
#include "prize.h"

using namespace std; 

int find_best(int n) {

	vector<int> ar = ask(0);

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

	for(int i = 2 ; i < n ; i += 2)
	{
		ar = ask(i);

		if(ar[0] + ar[1] == 0)
		{
			return i;
		}

		if(ar[1] == 0)
		{
			return i - 1;
		}
	}

	return n - 1;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...