제출 #953368

#제출 시각아이디문제언어결과실행 시간메모리
953368sopaconk경주 (Race) (IOI11_race)C++17
컴파일 에러
0 ms0 KiB
#include "race.h" #include <stdio.h> #include <stdlib.h> #define MAX_N 500000 static int N, K; static int H[MAX_N][2]; static int L[MAX_N]; static int solution; inline void my_assert(int e) {if (!e) abort();} void read_input() { int i; my_assert(2==scanf("%d %d",&N,&K)); for(i=0; i<N-1; i++) my_assert(3==scanf("%d %d %d",&H[i][0],&H[i][1],&L[i])); my_assert(1==scanf("%d",&solution)); } int main() { int ans; read_input(); ans = best_path(N,K,H,L); if(ans==solution) printf("Correct.\n"); else printf("Incorrect. Returned %d, Expected %d.\n",ans,solution); return 0; }

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

/usr/bin/ld: /tmp/ccsocvWO.o: in function `read_input()':
race.cpp:(.text+0x0): multiple definition of `read_input()'; /tmp/ccFB7igQ.o:grader.cpp:(.text+0x0): first defined here
/usr/bin/ld: /tmp/ccsocvWO.o: in function `main':
race.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccFB7igQ.o:grader.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccFB7igQ.o: in function `main':
grader.cpp:(.text.startup+0x28): undefined reference to `best_path(int, int, int (*) [2], int*)'
/usr/bin/ld: /tmp/ccsocvWO.o: in function `main':
race.cpp:(.text.startup+0x28): undefined reference to `best_path(int, int, int (*) [2], int*)'
collect2: error: ld returned 1 exit status