# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
701638 | phi | Commuter Pass (JOI18_commuter_pass) | C++17 | 1232 ms | 262144 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 <iostream>
#include <vector>
#include <queue>
#include <utility>
#include <tuple>
#include <cmath>
using namespace std;
vector<long long> min_dist(vector<vector<pair<int, long long>>> &adj, int source, int n) {
vector<long long> depth(n, -1);
using T = pair<long long, int>;
priority_queue<T, vector<T>, greater<T>> q;
q.push({ 0, source });
while (!q.empty()) {
auto [ d, v ] = q.top();
q.pop();
if (depth[v] != -1) continue;
depth[v] = d;
for (auto [ u, w ] : adj[v]) {
q.push({ d + w, u });
}
}
return depth;
}
# | 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... |