Submission #225901

# Submission time Handle Problem Language Result Execution time Memory
225901 2020-04-22T01:01:54 Z pavement Lost in the cycle (IOI19_cycle) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

void escape(int n) {
	int cur = 0, lo = 0, hi = n - 1, ans = -1;
	while (lo <= hi) {
		int mid = (lo + hi) >> 1;
		bool x = jump(mid >= cur ? mid - cur : n - cur + mid);
		cur = mid;
		if (x) ans = mid, hi = mid - 1;
		else lo = mid + 1;
	}
	jump((ans >= cur ? ans - cur : n - cur + ans) + n / 2);
}

Compilation message

cycle.cpp: In function 'void escape(int)':
cycle.cpp:8:12: error: 'jump' was not declared in this scope
   bool x = jump(mid >= cur ? mid - cur : n - cur + mid);
            ^~~~
cycle.cpp:8:12: note: suggested alternative: 'bcmp'
   bool x = jump(mid >= cur ? mid - cur : n - cur + mid);
            ^~~~
            bcmp
cycle.cpp:13:2: error: 'jump' was not declared in this scope
  jump((ans >= cur ? ans - cur : n - cur + ans) + n / 2);
  ^~~~
cycle.cpp:13:2: note: suggested alternative: 'bcmp'
  jump((ans >= cur ? ans - cur : n - cur + ans) + n / 2);
  ^~~~
  bcmp