This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "cycle.h"
#include <bits/stdc++.h>
using namespace std;
int p, n;
bool go_to_room(int room)
{
bool res = jump( (room - p + n) % n );
p = room;
return res;
}
void escape(int _n)
{
n = _n;
int st = 1, dr = n-1, mid;
p = 0;
while(st < dr)
{
mid = (st + dr) / 2;
if(go_to_room((mid - n/2 + n) % n)) dr = mid;
else st = mid + 1;
}
go_to_room(st);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |