답안 #767625

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
767625 2023-06-26T23:13:51 Z tigar 곤돌라 (IOI14_gondola) C++14
컴파일 오류
0 ms 0 KB
//#include "gondola.h"
#include <bits/stdc++.h>

using namespace std;

int valid(int n, int* inputSeq)
{
    int last=-1, pos=-1;
    for(int i=0; i<n; i++)
    {
        if(inputSeq[i]<=n and last==-1){last=inputSeq[i]; pos=i;}
        else if(inputSeq[i]<=n)
        {
            if((last+i-pos)%n==(inputSeq[i])%n){last=inputSeq[i]; pos=i;}
            else {return 0;}
        }
    }
    return 1;
}

int replacement(int n, int* gondolaSeq, int* replacementSeq)
{
	return 2005;
}

int countReplacement(int n, int* inputSeq)
{
	return 24;
}

int main()
{
    int n; cin>>n;
    int gondole[n];
    for(int i=0; i<n; i++)cin>>gondole[i];
    cout<<valid(n, gondole);
}

Compilation message

/usr/bin/ld: /tmp/ccQGIAPI.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccR2LwcM.o:gondola.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccQGIAPI.o: in function `main':
grader.cpp:(.text.startup+0xb6): undefined reference to `valid'
/usr/bin/ld: grader.cpp:(.text.startup+0x108): undefined reference to `countReplacement'
/usr/bin/ld: grader.cpp:(.text.startup+0x132): undefined reference to `replacement'
collect2: error: ld returned 1 exit status