Submission #982277

#TimeUsernameProblemLanguageResultExecution timeMemory
982277Vedang1006The Big Prize (IOI17_prize)C++14
0 / 100
1 ms600 KiB
#include "prize.h"

int find_best(int n) {
	int i = 0;

	for (int jumpSize = 30; jumpSize >= 0; jumpSize--)
	{
		if (i + (1<<jumpSize) < n && ask(i + (1<<jumpSize))[1] == 1) i += (1<<jumpSize);
	}

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