#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);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
248 KB |
The exit was not found. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
248 KB |
The exit was not found. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
248 KB |
The exit was not found. |
2 |
Halted |
0 ms |
0 KB |
- |