Submission #225791

#TimeUsernameProblemLanguageResultExecution timeMemory
225791BlerarghLost in the cycle (IOI19_cycle)C++17
33 / 100
5 ms384 KiB
#include <bits/stdc++.h>
#include "cycle.h"
using namespace std;

void escape(int n){
  bool chk;
  int half = n/2;
  if (!jump(half)){
    chk = jump(n-half);
  }
  
  int l=0, r=half, prevjump=n;
  while (l+1<r){
    int mid = (l+r)/2;
	chk = jump((mid+n-prevjump)%n);
    if (chk) l=mid;
    else r=mid-1;
    prevjump = mid;
  }
  chk = jump((l+n-prevjump)%n);
  if (l+1 == r){
	  if (!jump(1)){
		  chk = jump(n-1);
	  }
  }

  return;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...