| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 580767 | Omar_Elgedawy | Lost in the cycle (IOI19_cycle) | C++14 | 1 ms | 208 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
//#include "grader.cpp"
 #include "cycle.h"
using namespace std;
void escape(int n) {
	if(jump(0)){
		int loc=0,one=0;
		int l=1,r=n-1;
		if(n%2==0&&jump(n/2)){
			return;
		}
		if(n%2==0){
			// cout<<n/2<<endl<<n/2+n%2<<endl;
			loc+=n/2;
			loc=(loc+n/2+n%2)%n;
			jump(n/2+n%2);
		}
		// cout<<loc<<endl;
		while(l<=r){
			int m=(r+l)/2;
			int dist;
			if(m>loc)
				dist=m-loc;
			else
				dist=((n-loc)+m)%n;
			loc=(loc+dist)%n;
			// cout<<loc<<' '<<dist<<endl;
			if(jump(dist)){
				r=m-1;
				one=loc;
			}
			else{
				l=m+1;
			}
		}
		cout<<loc<<' '<<one<<' ';
		if(loc<one){
			loc=(loc+(one-loc))%n;
			jump(one-loc);
		}
		else if(loc>one){
			loc=(loc+(n-loc)+one)%n;
			jump(((n-loc)+one)%n);
		}
		// cout<<(loc+n/2)%n<<endl;
		jump(n/2+n%2);
	}
	else{
		int loc=0,one;
		int l=1,r=n-1;
		while(l<=r){
			int m=(r+l)/2;
			int dist;
			if(m>loc)
				dist=m-loc;
			else
				dist=(n-loc)+m;
			loc=(loc+dist)%n;
			if(jump(dist)){
				r=m-1;
				one=loc;
			}
			else{
				l=m+1;
			}
		}
		if(loc<one)
			jump(one-loc);
		else if(loc>one)
			jump((n-loc)+one);
		jump(n/2);
	}
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
