답안 #225905

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
225905 2020-04-22T01:44:58 Z pavement Lost in the cycle (IOI19_cycle) C++17
0 / 100
6 ms 384 KB
#include "cycle.h"
#include <bits/stdc++.h>
using namespace std;

void escape(int n) {
	int cur = 0, lo = 0, hi = n / 2, ans = -1;
	if (jump(n - 1)) {
		jump(1);
		while (lo <= hi) {
			int mid = (lo + hi) >> 1;
			bool x = jump(mid <= cur ? cur - mid : n - llabs(cur - mid));
			cur = mid;
			if (x) ans = mid, lo = mid + 1;
			else hi = mid - 1;
		}
		jump((ans <= cur ? cur - ans : n - llabs(cur - ans)) + n / 2);
	} else {
		jump(1);
		while (lo <= hi) {
			int mid = (lo + hi) >> 1;
			bool x = jump(mid >= cur ? mid - cur : n - cur + mid);
			cur = mid;
			if (x) ans = mid, hi = mid - 1;
			else lo = mid + 1;
		}
		jump((ans >= cur ? ans - cur : n - cur + ans) + n / 2);
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Output is correct
2 Incorrect 4 ms 256 KB The exit was not found.
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 4 ms 384 KB Output is correct
3 Correct 4 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 6 ms 384 KB Output is correct
6 Incorrect 5 ms 384 KB The exit was not found.
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Output is correct
2 Incorrect 4 ms 256 KB The exit was not found.
3 Halted 0 ms 0 KB -