#include<bits/stdc++.h>
#include "cycle.h"
using namespace std;
int p=1,n=10;
/*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+r)%n);
return;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Correct |
2 ms |
248 KB |
Output is correct |
5 |
Correct |
2 ms |
252 KB |
Output is correct |
6 |
Incorrect |
2 ms |
376 KB |
The exit was not found |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Incorrect |
2 ms |
376 KB |
The exit was not found |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Correct |
2 ms |
248 KB |
Output is correct |
5 |
Correct |
2 ms |
252 KB |
Output is correct |
6 |
Incorrect |
2 ms |
376 KB |
The exit was not found |
7 |
Halted |
0 ms |
0 KB |
- |