# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1003261 | 2024-06-20T08:18:08 Z | coolboy19521 | Crocodile's Underground City (IOI11_crocodile) | C++17 | 4 ms | 604 KB |
#include "bits/stdc++.h" #include "crocodile.h" using namespace std; const int sz = 1e3 + 3; vector<vector<int>> aj[sz]; int d[sz]; int dfs(int v, int p = -1, int l = 0) { d[v] = l; for (auto& u : aj[v]) { int to = u[0]; int we = u[1]; if (to != p) { dfs(to, v, l + we); } } } int travel_plan(int N, int M, int R[][2], int L[], int K, int P[]) { for (int i = 0; i < M; i ++) { int a = R[i][0]; int b = R[i][1]; aj[a].push_back({b, L[i]}); aj[b].push_back({a, L[i]}); } dfs(0); int mx = 0; for (int i = 0; i < K; i ++) { mx = max(mx, d[P[i]]); } return mx; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 4 ms | 604 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 4 ms | 604 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 4 ms | 604 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |