Submission #838387

# Submission time Handle Problem Language Result Execution time Memory
838387 2023-08-26T18:28:06 Z beaboss Lost in the cycle (IOI19_cycle) C++14
0 / 100
1 ms 276 KB
#include "cycle.h"

void escape(int n) {
	bool works = jump(0);

	while (!works) jump(n/2);

	int lo = 0;
	int hi = n/2;
	int cur_dist = 0;

	while (lo < hi) {
		int m = (lo + hi)/2;

		if (jump((m - cur_dist + n) % n)) {
			lo = m;
		} else hi = m-1;

		cur_dist = m;
	}

	jump((lo - cur_dist + n) % n);

}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 276 KB Too many queries.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Too many queries.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 276 KB Too many queries.
2 Halted 0 ms 0 KB -