Submission #984857

#TimeUsernameProblemLanguageResultExecution timeMemory
98485754skyxenonCrocodile's Underground City (IOI11_crocodile)C++17
Compilation error
0 ms0 KiB
// https://oj.uz/problem/view/IOI11_crocodile #include <bits/stdc++.h> using namespace std; #define int long long vector<map<int, int>> graph; vector<bool> is_exit; vector<bool> visited; int dfs(int curr) { if (is_exit[curr]) { return 0; } vector<int> distances; for (auto [nei, weight] : graph[curr]) { if (!visited[nei]) { visited[nei] = true; distances.push_back(weight + dfs(nei)); } } sort(distances.begin(), distances.end()); return distances[1]; } int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, m, k; cin >> n >> m >> k; graph.resize(n); for (int i = 0; i < m; i++) { int u, v, w; cin >> u >> v >> w; graph[u][v] = graph[v][u] = w; } is_exit.resize(n); visited.resize(n); for (int i = 0; i < k; i++) { int p; cin >> p; is_exit[p] = true; } visited[0] = true; cout << dfs(0) << '\n'; }

Compilation message (stderr)

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