제출 #29224

#제출 시각아이디문제언어결과실행 시간메모리
29224ruhanhabib39공장들 (JOI14_factories)C++11
컴파일 에러
0 ms0 KiB
#include "factories.h" #include <bits/stdc++.h> using namespace std; const int MAXN = 5e5; const int MAXLG = 20; const long long INF = 1e18; int N; vector<pair<int,int>> G[MAXN + 10]; int cc[MAXN + 10]; int level[MAXN + 10]; long long dis[MAXLG + 10][MAXN + 10]; bool done[MAXN + 10]; int par[MAXN + 10]; void dfs0(int u, int p) { cc[u] = 1; for(auto e : G[u]) { int v = e.first; if(v == p || done[v]) continue; dfs0(v, u); cc[u] += cc[v]; } } void dfs(int u, int p, long long ds) { // cerr << u << " " << p << " " << ds << "\n"; dis[++level[u]][u] = ds; // cerr << "dis[" << level[u] << "][" << u << "] = " << dis[level[u]][u] << "\n"; for(auto e : G[u]) { int v, d; tie(v, d) = e; if(v == p || done[v]) continue; dfs(v, u, ds + d); } } int cnt; int centroid(int u, int p) { for(auto e : G[u]) { int v = e.first; if(v == p || done[v]) continue; if(cc[v] > cnt/2) return centroid(v, u); } return u; } void decomp(int u, int p) { dfs0(u, -1); cnt = cc[u]; u = centroid(u, -1); dfs(u, -1, 0); // cerr << "centroid = " << u << "\n"; par[u] = p; done[u] = true; for(auto e : G[u]) { int v = e.first; if(done[v]) continue; decomp(v, u); } }

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

/tmp/ccpbB486.o: In function `main':
grader.cpp:(.text.startup+0x279): undefined reference to `Init(int, int*, int*, int*)'
grader.cpp:(.text.startup+0x307): undefined reference to `Query(int, int*, int, int*)'
collect2: error: ld returned 1 exit status