제출 #1330201

#제출 시각아이디문제언어결과실행 시간메모리
1330201apxoLost in the cycle (IOI19_cycle)C++20
100 / 100
1 ms400 KiB
#include "cycle.h"

void escape(int n) {
  int lst = 0;
  int l, r, res = -1;
  if (jump(0)) {
    l = 0, r = n / 2;
  } else {
    l = n / 2 + 1, r = n - 1;
  }
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (jump((mid - lst + n) % n)) {
      res = mid;
      l = mid + 1; 
    } else r = mid - 1;
    lst = mid;
  }
  jump((res - lst + n) % n);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...