제출 #517082

#제출 시각아이디문제언어결과실행 시간메모리
517082Ai7081Stations (IOI20_stations)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; const int N = 1005; int cnt, cnt2; vector<int> ret; vector<vector<int>> adj; void dfs(int v, int p) { ret[v] = 1000*cnt2 + cnt; //cout << v << ' ' << ret[v] << endl; cnt2++; for (auto to : adj[v]) { if (to != p) { dfs(to, v); } } return; } vector<int> label(int n, int k, vector<int> u, vector<int> v) { adj.assign(n, vector<int>()); for (int i=0; i<(int)u.size(); i++) { adj[u[i]].push_back(v[i]); adj[v[i]].push_back(u[i]); } for (int i=0; i<n; i++) { if (adj[i].size() > 2) { ret.assign(n, 0); ret[i] = 0; cnt = 1; for (auto x : adj[i]) { cnt2 = 0; dfs(x, i); cnt++; } break; } } return ret; }

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

/usr/bin/ld: /tmp/cck9LGYu.o: in function `main':
stub.cpp:(.text.startup+0x4cc): undefined reference to `find_next_station(int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status