답안 #272760

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
272760 2020-08-18T15:14:21 Z petar_vitorac Lost in the cycle (IOI19_cycle) C++14
0 / 100
0 ms 256 KB
#include "cycle.h"

void escape(int n) {
	bool result = jump(1);
	if(result!=1) jump(n/2);
	long long pos = 0; long long Lpos = 0; long long Rpos = n/2; long long mid;
	
	for(;;) {
		mid = (Lpos+Rpos)/2;
		if(Lpos==Rpos) {
			return;
		}
		
		else if (pos > mid) result = jump(n-(pos-mid));
		else result = jump(mid-pos);
		
		if (result==1) Lpos = mid+1;
		else Rpos = mid;
		
		pos = mid;
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Incorrect 0 ms 256 KB The exit was not found.
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 256 KB The exit was not found.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Incorrect 0 ms 256 KB The exit was not found.
4 Halted 0 ms 0 KB -