## Submission #851223

# Submission time Handle Problem Language Result Execution time Memory
851223 2023-09-19T02:10:24 Z NeroZein Crocodile's Underground City (IOI11_crocodile) C++17
0 / 100
6 ms 8792 KB
```#include "crocodile.h"
#include "bits/stdc++.h"
using namespace std;

int travel_plan(int N, int M, int R[][2], int L[], int K, int P[])
{
vector<vector<pair<int, int>>> g(N);
for (int i = 0; i < M; ++i) {
g[R[i][0]].emplace_back(R[i][1], L[i]);
g[R[i][1]].emplace_back(R[i][0], L[i]);
}
const int INF = 1e9;
vector<vector<int>> dis(N, vector<int> (2, INF));
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
for (int i = 0; i < K; ++i) {
dis[P[i]][0] = dis[P[i]][1] = 0;
pq.emplace(0, P[i]);
}
while (!pq.empty()) {
auto [c, v] = pq.top();
pq.pop();
if (c != dis[v][1]) {
continue;
}
for (auto [u, w] : g[v]) {
int nc = c + w;
if (nc < dis[u][0]) {
if (dis[u][0] < dis[u][1]) {
dis[u][1] = dis[u][0];
pq.emplace(u, dis[u][1]);
}
dis[u][0] = nc;
} else {
dis[u][1] = nc;
pq.emplace(u, dis[u][1]);
}
}
}
return dis[0][1];
}
```

#### Subtask #1 0 / 46.0

# Verdict Execution time Memory Grader output
1 Runtime error 6 ms 8792 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -

#### Subtask #2 0 / 43.0

# Verdict Execution time Memory Grader output
1 Runtime error 6 ms 8792 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -

#### Subtask #3 0 / 11.0

# Verdict Execution time Memory Grader output
1 Runtime error 6 ms 8792 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -