제출 #362288

#제출 시각아이디문제언어결과실행 시간메모리
362288saifuTraffic (IOI10_traffic)C++14
컴파일 에러
0 ms0 KiB
// ----- In the name of ALLAH, the Most Gracious, the Most Merciful ----- #include "traffic.h" #include<bits/stdc++.h> using namespace std; #define int long long #define endl "\n" #define mod 1000000007 #define inf (int)1e18 const int mxn = 1e6+10; vector<int> g[mxn]; int people[mxn]; int dp[mxn]; void dfs(int v, int p=-1){ dp[v] = people[v]; for(int u : g[v]){ if(u==p) continue; dfs(u,v); dp[v] += dp[u]; } } int LocateCentre (int n, int p[], int d[], int s[]){ for(int i=0;i<n;i++) people[i] = p[i]; for(int i=0;i<n-1;i++){ g[s[i]].push_back(d[i]); g[d[i]].push_back(s[i]); } int mn = inf; for(int i=0;i<n;i++){ for(int j=0;j<n;j++) dp[i] = 0; dfs(i); int mx = 0; for(int u : g[i]){ mx = max(mx,dp[u]); } mn = min(mn,mx); } return mn; }

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

/tmp/ccDpUEVK.o: In function `main':
grader.cpp:(.text.startup+0xd9): undefined reference to `LocateCentre(int, int*, int*, int*)'
collect2: error: ld returned 1 exit status