제출 #373308

#제출 시각아이디문제언어결과실행 시간메모리
373308No_IceTraffic (IOI10_traffic)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long const int mxN = 1e6; const ll INF = 1e17; int N; vector<int> adj[mxN]; ll fans[mxN]; ll ans = INF; ll dfs(int u, int p = -1) { ll sum = 0; for (int v : adj[u]) { if (v != p) { ll c_sum = 0; c_sum += fans[v]; c_sum += dfs(v, u); sum = max(sum, c_sum); } } return sum; } int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> N; for (int i=0; i < N; i++) { cin >> fans[i]; } for (int i=0; i < N-1; i++) { int u, v; cin >> u >> v; adj[u].push_back(v); adj[v].push_back(u); } int ans1 = 0; for (int i=0; i < N; i++) { ll temp = dfs(i); if (temp < ans) { ans = temp; ans1 = i; } } cout << ans1 << '\n'; return 0; }

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

/tmp/ccE9DB2K.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc5kjz8X.o:traffic.cpp:(.text.startup+0x0): first defined here
/tmp/ccE9DB2K.o: In function `main':
grader.cpp:(.text.startup+0xd9): undefined reference to `LocateCentre(int, int*, int*, int*)'
collect2: error: ld returned 1 exit status