제출 #714479

#제출 시각아이디문제언어결과실행 시간메모리
714479tcmmichaelb139Crocodile's Underground City (IOI11_crocodile)C++17
컴파일 에러
0 ms0 KiB
#include "bits/stdc++.h" #include "crocodile.h" using namespace std; struct node { int v; long long time; bool operator<(const node &rhs) const { return time > rhs.time; } }; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, m, k; cin >> n >> m >> k; vector<pair<int, long long>> adj[n + 1]; for (int i = 0; i < m; i++) { long long a, b, c; cin >> a >> b >> c; adj[a].push_back({b, c}); adj[b].push_back({a, c}); } vector<int> p(k); for (int i = 0; i < k; i++) cin >> p[i]; vector<int> vis(n + 1, 0); priority_queue<node> q; for (auto i : p) { q.push({i, 0}), vis[i] = 2; } while (!q.empty()) { node v = q.top(); q.pop(); vis[v.v]++; if (vis[v.v] < 2) continue; if (v.v == 0) { cout << v.time << '\n'; break; } for (auto u : adj[v.v]) { q.push({u.first, u.second + v.time}); } } }

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

/usr/bin/ld: /tmp/cc4ZJuxz.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccX8wmDw.o:crocodile.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc4ZJuxz.o: in function `main':
grader.cpp:(.text.startup+0x36): undefined reference to `travel_plan(int, int, int (*) [2], int*, int, int*)'
collect2: error: ld returned 1 exit status