Submission #687245

#TimeUsernameProblemLanguageResultExecution timeMemory
687245sharaelongCrocodile's Underground City (IOI11_crocodile)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #ifdef SHARAELONG #include "../../cpp-header/debug.hpp" #endif using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAX_N = 1e5 + 1; const ll INF = 1e18; vector<pll> adj[MAX_N]; pll dist[MAX_N]; void dijkstra() { priority_queue<pll> pq; for (int i=0; i<MAX_N; ++i) { if (dist[i].second == 0) { pq.push({ 0, i }); } } while (!pq.empty()) { ll len = -pq.top().first; ll here = pq.top().second; pq.pop(); for (auto[there, c]: adj[here]) { if (len+c < dist[there].first) { dist[there].second = dist[there].first; dist[there].first = len+c; pq.push({ -dist[there].second, there }); } else if (len+c < dist[there].second) { dist[there].second = len+c; pq.push({ -dist[there].second, there }); } } } } void solve() { int n, m, k; cin >> n >> m >> k; for (int i=0; i<m; ++i) { int a, b, c; cin >> a >> b >> c; adj[a].push_back({b, c}); adj[b].push_back({a, c}); } for (int i=0; i<MAX_N; ++i) dist[i] = { INF, INF }; for (int i=0; i<k; ++i) { int x; cin >> x; dist[x] = { 0, 0 }; } dijkstra(); cout << dist[0].second; } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); solve(); }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccVX0VEJ.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc6xEJKI.o:crocodile.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccVX0VEJ.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