이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cycle.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
void escape(int n) {
if(n==2) {
jump(1);
return;
}
bool x=jump(0);
if(x) x=jump((n-1)/2);
while(x) x=jump(1);
int akt=n-1;
int po=n-(n-1)/2, ko=n-1;
while(po<ko) {
int sr=(po+ko)/2;
x=jump((sr-akt+n)%n);
akt=sr;
if(x) po=sr+1; else ko=sr;
}
jump((po-1-akt+2*n)%n);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |