# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
909954 | Pekiban | Commuter Pass (JOI18_commuter_pass) | C++17 | 500 ms | 21084 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 mxN = 1e5+2;
const long long inf = 1e18;
vector<pair<int, int>> g[mxN];
vector<long long> dists(mxN), distu(mxN), distv(mxN), mn(mxN), dist(mxN);
bool visited[mxN];
void dijkstra(int s, vector<long long> &dist) {
fill(visited, visited+mxN, 0);
fill(dist.begin(), dist.end(), inf);
dist[s] = 0;
priority_queue<pair<long long, int>, vector<pair<long long, int>>, greater<>> pq;
pq.push({0, s});
while (!pq.empty()) {
auto [x, u] = pq.top();
pq.pop();
if (visited[u]) continue;
visited[u] = 1;
for (auto [v, w] : g[u]) {
if (dist[v] > x + w) {
dist[v] = x + w;
pq.push({dist[v], v});
}
}
}
}
int n, m;
long long f(int S, int T, int U, int V) {
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... |