답안 #228024

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
228024 2020-04-29T14:42:51 Z jzh Lost in the cycle (IOI19_cycle) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
void escape (int n){
    int x = n, y;
    if (jump(0)){
        x = n/2;
    }
    else {
        x = n/2;
        x *= -1;
    }
    bool b;
    while (abs(x)>0){
        y = x;
        if (y<0)y+=n;
        y%=n;
        //cout<<x<<' '<<y<<'\n';
        if (jump(y)){
            x = abs(x) + x%2;
            //cout<<"True\n";
            b = true;
            x = x/2;
        }
        else {
            x = -1*abs(x);
            //cout<<"False\n";
            b = false;
            x = x/2 - abs(x)%2;
        }
        //cout<<ans<<'\n';
        //x = x/2 + x%2;
    }
    if (!b)jump(n-1);
}

Compilation message

cycle.cpp: In function 'void escape(int)':
cycle.cpp:5:9: error: 'jump' was not declared in this scope
     if (jump(0)){
         ^~~~
cycle.cpp:5:9: note: suggested alternative: 'bcmp'
     if (jump(0)){
         ^~~~
         bcmp
cycle.cpp:18:13: error: 'jump' was not declared in this scope
         if (jump(y)){
             ^~~~
cycle.cpp:18:13: note: suggested alternative: 'bcmp'
         if (jump(y)){
             ^~~~
             bcmp
cycle.cpp:33:12: error: 'jump' was not declared in this scope
     if (!b)jump(n-1);
            ^~~~
cycle.cpp:33:12: note: suggested alternative: 'bcmp'
     if (!b)jump(n-1);
            ^~~~
            bcmp