이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "cycle.h"
using namespace std;
/*bool jump(int x) {
p = (p + x) % n;
cout<<p<<endl;
return (n - p) % n <= n / 2;
}*/
void escape(int n){
int l=0,r=0;
if(jump(0)){
l=0;
r=n/2;
}
else{
l=n/2+1;
r=n-1;
}
int h=0;
while(r-l>1){
int mid=((l+r)/2)+h;
h=n-(l+r)/2;
mid=mid%n;
if(jump(mid))
l=(l+r)/2;
else
r=(l+r)/2;
}
if(jump((h+r)%n))
return;
h=n-r;
jump((h+l)%n);
return;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |