Submission #225784

#TimeUsernameProblemLanguageResultExecution timeMemory
225784BlerarghLost in the cycle (IOI19_cycle)C++17
0 / 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<r){
    int mid = (l+r)/2;
	int tojump = mid+n-prevjump;   
	if (tojump>=n) chk=jump(n-prevjump), prevjump=n;
    if (jump(mid+n-prevjump)) l=mid;
    else  r=mid-1;
    prevjump = mid;
  }
  chk = jump(l+n-prevjump);
  return;
}

Compilation message (stderr)

cycle.cpp: In function 'void escape(int)':
cycle.cpp:6:8: warning: variable 'chk' set but not used [-Wunused-but-set-variable]
   bool chk;
        ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...