제출 #347463

#제출 시각아이디문제언어결과실행 시간메모리
347463milleniumEeee열대 식물원 (Tropical Garden) (IOI11_garden)C++17
컴파일 에러
0 ms0 KiB
#include "garden.h" #include "gardenlib.h" #include "grader.cpp" #include <bits/stdc++.h> #define int long long using namespace std; const int MAXN = 150005; int k; int n, m, p; vector <int> g[MAXN]; int dfs(int v, int par = -1, int len = 0) { if (len == k) { if (v == p) { return 1; } else { return 0; } } int best = 1e9; for (int to : g[v]) { if (to != par) { best = min(best, to); } } if (best == 1e9) { return dfs(par, v, len + 1); } else { return dfs(best, v, len + 1); } } void count_routes(int N, int M, int P, int R[][2], int Q, int G[]) { n = N; m = M; p = P; for (int i = 0; i < M; i++) { g[R[i][0]].push_back(R[i][1]); g[R[i][1]].push_back(R[i][0]); } for (int i = 0; i < Q; i++) { k = G[i]; int ans = 0; for (int v = 0; v < N; v++) { ans += dfs(v); } answer(ans); } }

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

/tmp/ccpjmoZq.o: In function `read_input()':
grader.cpp:(.text+0x0): multiple definition of `read_input()'
/tmp/ccCVXuOB.o:garden.cpp:(.text+0x60): first defined here
/tmp/ccpjmoZq.o: In function `answer(int)':
grader.cpp:(.text+0x130): multiple definition of `answer(int)'
/tmp/ccCVXuOB.o:garden.cpp:(.text+0x190): first defined here
/tmp/ccpjmoZq.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccCVXuOB.o:garden.cpp:(.text.startup+0x0): first defined here
/tmp/ccCVXuOB.o: In function `main':
garden.cpp:(.text.startup+0x3b): undefined reference to `count_routes(int, int, int, int (*) [2], int, int*)'
/tmp/ccpjmoZq.o: In function `main':
grader.cpp:(.text.startup+0x3b): undefined reference to `count_routes(int, int, int, int (*) [2], int, int*)'
collect2: error: ld returned 1 exit status