제출 #1133415

#제출 시각아이디문제언어결과실행 시간메모리
1133415mnbvcxz123Lost in the cycle (IOI19_cycle)C++20
100 / 100
0 ms408 KiB
#include <bits/stdc++.h>
#include "cycle.h"

void escape(int n) {
	if (n == 2){ jump(1);return;}
	
	int pos = 0;
	int l = 0;
	int r = n-1;
	while (l != r) {
		int mid = (l+r+1)/2;
		int j = mid - pos;
		j = (j+n)%n;
		if (j == 0) j =1;
		if (jump(j)) {
			l = mid;
		} else {
			r = mid-1;
		}
		pos = mid;
	}
	int j = l - pos;
	j = (j+n)%n;
	jump(j);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...