제출 #102552

#제출 시각아이디문제언어결과실행 시간메모리
102552Leonardo_Paes곤돌라 (IOI14_gondola)C++11
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#include "gondola.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[]){
    return 0;
}

int countReplacement(int n, int inputSeq[]){
    return 0;
}

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

gondola.cpp: In function 'bool valid(int, int*)':
gondola.cpp:6:6: error: ambiguating new declaration of 'bool valid(int, int*)'
 bool valid(int n, int vet[]){
      ^~~~~
In file included from gondola.cpp:2:0:
gondola.h:8:5: note: old declaration 'int valid(int, int*)'
 int valid(int n, int inputSeq[]);
     ^~~~~