제출 #1308675

#제출 시각아이디문제언어결과실행 시간메모리
1308675raineyjLost in the cycle (IOI19_cycle)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; void escape(int n) { if(n==2) jump(1); else { int l=0, r=n, prev=0; bool last=false; while(l<r) { int mid=(l+r)/2; if(jump(mid+prev)) { prev+=mid; r=mid; last=true; } else { l=mid+1; prev-=mid; last=false; } } if(last==true) jump(n/2); else jump((n/2)+1); } } bool jump(int x)

컴파일 시 표준 에러 (stderr) 메시지

cycle.cpp: In function 'void escape(int)':
cycle.cpp:6:14: error: 'jump' was not declared in this scope
    6 |     if(n==2) jump(1);
      |              ^~~~
cycle.cpp:14:16: error: 'jump' was not declared in this scope
   14 |             if(jump(mid+prev))
      |                ^~~~
cycle.cpp:27:24: error: 'jump' was not declared in this scope
   27 |         if(last==true) jump(n/2);
      |                        ^~~~
cycle.cpp:28:14: error: 'jump' was not declared in this scope
   28 |         else jump((n/2)+1);
      |              ^~~~
cycle.cpp: At global scope:
cycle.cpp:32:17: error: expected initializer at end of input
   32 | bool jump(int x)
      |                 ^