Submission #228489

#TimeUsernameProblemLanguageResultExecution timeMemory
228489w4123Lost in the cycle (IOI19_cycle)C++17
100 / 100
5 ms384 KiB
#include "cycle.h"




void escape(int n) {
	int ncount = n;
	int res = jump(0);
	if(res == true)
	{
		res = jump(ncount / 2);
	}
	else
	{
		res = jump((n - ncount / 2)%n);
	}
	while(ncount > 1)
	{
		if(res==false)
		{
			ncount -= ncount / 2;
			res = jump((n - ncount / 2)%n);
			if (ncount == 1)
			{
				jump(n - 1);
			}
		}
		else
		{
			ncount -= ncount / 2;
			res = jump(ncount / 2);
		}
	}

}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...