제출 #441673

#제출 시각아이디문제언어결과실행 시간메모리
441673mateTraffic (IOI10_traffic)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #define ll long long #define ull unsigned ll #define pii pair<int,int> #define pll pair<ll,ll> #define ff first #define ss second #define pb push_back #define INF LLONG_MAX using namespace std; const int NMAX=200001; ll p[NMAX],d[NMAX]; vector<int> g[NMAX]; void DFS(int v,int e=-1){ d[v]=p[v]; for(int u: g[v]) if(u!=e){ DFS(u,v); d[v]+=d[u]; } } ll mn=INF; void dfs(int v,int e=-1){ ll ans=d[1]-d[v]; for(int u: g[v]) if(u!=e){ dfs(u,v); ans=max(ans,d[u]); } mn=min(mn,ans); } int main(){ int n; cin >> n; for(int i=1;i<=n;i++) cin >> p[i]; for(int i=1;i<n;i++){ int v,u; cin >> v >> u; g[v].pb(u); g[u].pb(v); } DFS(1); dfs(1); cout << mn; }

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

/usr/bin/ld: /tmp/ccaSX8yr.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc3hQt2p.o:traffic.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccaSX8yr.o: in function `main':
grader.cpp:(.text.startup+0xe1): undefined reference to `LocateCentre(int, int*, int*, int*)'
collect2: error: ld returned 1 exit status