# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1045842 | vjudge1 | Evacuation plan (IZhO18_plan) | C++17 | 110 ms | 19284 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int N = 100011;
vector<int> qr[N];
vector<pair<int, int>> g[N];
long long d[N], p[N], res[N];
int cur = 0;
void dijkstra() {
int k;
cin >> k;
fill(d + 1, d + N, LLONG_MAX);
set<pair<long long, int>> st;
for (int i = 0; i < k; i++) {
int x;
cin >> x;
d[x] = 0;
st.insert({0, x});
}
while (!st.empty()) {
int v = st.begin()->second;
st.erase(st.begin());
for (auto [to, w] : g[v]) {
if (d[to] > d[v] + w) {
st.erase({d[to], to});
d[to] = d[v] + w;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |