Submission #1132195

#TimeUsernameProblemLanguageResultExecution timeMemory
1132195finalventureLost in the cycle (IOI19_cycle)C++20
100 / 100
0 ms396 KiB
#include "cycle.h"

int N;

inline int back(int k) {
	return N-k;
}

void escape(int n) {
	N = n;
	int size = n / 2;
	int ok = jump(0);
	while (size) {
		if (ok) {
			ok = jump(size);
		} else {
			ok = jump(back(size));
		}
		if (size == 1) size = 0;
		else size = (size + 1) / 2;
	}
	if (!ok) jump(back(1));
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...