# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
565798 | 1zaid1 | Evacuation plan (IZhO18_plan) | C++14 | 418 ms | 78364 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;
#define endl '\n'
#define int long long
typedef long long ll;
const int M = 2e6 + 5, MOD = 1e9+7;
vector<pair<int, int>> node[M];
int dist[M], n, vis[M];
int dis[20][20];
int di[M];
void dij1() {
for (int i = 1; i <= n; i++) dist[i] = INT_MAX;
priority_queue<pair<int, int>> q;
int k;
cin >> k;
for (int i = 1; i <= k; i++) {
int a; cin >> a;
dist[a] = 0;
q.push({0, a});
}
while (!q.empty()) {
auto [new_dist, new_node] = q.top(); q.pop();
new_dist = -new_dist;
if (dist[new_node] < new_dist) continue;
for (auto [N, d]:node[new_node]) {
if (new_dist + d < dist[N]) {
dist[N] = new_dist + d;
q.push({-dist[N], N});
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... |