Submission #709635

#TimeUsernameProblemLanguageResultExecution timeMemory
709635therealpainCrocodile's Underground City (IOI11_crocodile)C++17
Compilation error
0 ms0 KiB
#include "crocodile.h" #include <bits/stdc++.h> using namespace std; const int N = 1e5 + 7; vector <pair <int, int>> adj[N]; bool special[N]; int n, m, k; namespace sub1 { long long dist[1000][1000]; long long dp[1000][2]; void dfs1(int u, int p, int root) { for (auto [v, w] : adj[u]) { if (v == p || v == root) continue; dist[root][v] = dist[root][u] + w; dfs1(v, u, root); } } void dfs2(int u, int p) { if (special[u] == true) { dp[u][0] = dp[u][1] = 0; return; } for (auto [v, w] : adj[u]) { if (v == p) continue; dfs2(v, u); if (dp[u][0] > dp[v][1] + w) { dp[u][1] = dp[u][0]; dp[u][0] = dp[v][1] + w; } else if (dp[u][1] > dp[v][1] + w) { dp[u][1] = dp[v][1] + w; } } } long long solve() { for (int i = 0; i < n; ++i) { dfs1(i, i, i); } memset(dp, 0x3f, sizeof dp); dfs2(0, 0); return dp[0][1]; } }; int travel_plan(int N, int M, int K, int R[][2], int L[], int P[]) { n = N; m = M; k = K; for (int i = 0; i < m; ++i) { int u = R[i][0], v = R[i][1], w = L[i]; adj[u].emplace_back(v, w); adj[v].emplace_back(u, w); } for (int i = 0; i < k; ++i) { int x; cin >> x; special[x] = true; } long long ans = sub1::solve(); return ans; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccUytlQP.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