답안 #102549

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
102549 2019-03-25T21:12:31 Z Leonardo_Paes 곤돌라 (IOI14_gondola) C++11
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;

bool valid(int n, int vet[]){

    int x=0;

    bool ok=true;

    for(int i=0; i<n; i++){
        if(vet[i]>n or vet[i+1]>n){
            continue;
        }
        else{
            if(i==n-1){
                if(vet[0]<vet[i]){
                    if(x==0){
                        x=1;
                    }
                    else{
                        ok=false;
                    }
                }
            }
            else if(vet[i+1]<vet[i]){
                if(x==0){
                    x=1;
                }
                else{
                    ok=false;
                }
            }
        }
    }
    return ok;
}

int replacement(int n, int gondolaSeq[], int replacementSeq[]){

}

int countReplacement(int n, int inputSeq[]){


}

Compilation message

gondola.cpp: In function 'int replacement(int, int*, int*)':
gondola.cpp:41:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
gondola.cpp: In function 'int countReplacement(int, int*)':
gondola.cpp:46:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
/tmp/cc0GBaAf.o: In function `main':
grader.cpp:(.text.startup+0xc3): undefined reference to `countReplacement'
grader.cpp:(.text.startup+0xe2): undefined reference to `valid'
grader.cpp:(.text.startup+0x106): undefined reference to `replacement'
collect2: error: ld returned 1 exit status