Submission #208634

# Submission time Handle Problem Language Result Execution time Memory
208634 2020-03-12T00:18:52 Z eriksuenderhauf Lost in the cycle (IOI19_cycle) C++14
0 / 100
5 ms 248 KB
#include <bits/stdc++.h>
#include "cycle.h"
using namespace std;
int n;

void solve(int idx, int fl) {
	cerr << idx << " " << fl << "\n";
	idx %= n;
	if (idx == (fl^1)) {
		if (idx) jump(n-idx);
		return;
	}
	if (fl) {
		int x = n - idx + 1;
		if (jump(x / 2))
			solve(idx + x / 2, 1);
		else
			solve(x / 2, 0);
	} else {
		int x = idx;
		if (jump(n-idx + x/2))
			solve(n - (x+1)/2 + 1, 1);
		else
			solve(x/2, 0);
	}
}

void escape(int n) {
	::n = n;
	if (jump(0))
		solve(n-n/2, 1);
	else
		solve(n-(n/2+1), 0);
}
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 248 KB The exit was not found.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 248 KB The exit was not found.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 248 KB The exit was not found.
2 Halted 0 ms 0 KB -