# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
41166 | ngkan146 | Commuter Pass (JOI18_commuter_pass) | C++11 | 402 ms | 97436 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>
#define ll long long
using namespace std;
struct edge{
int v, w;
edge(int v=0,int w=0): v(v), w(w) {}
};
int n,m,s,t,u,v;
vector <edge> G[100005];
vector <int> dag[100005];
ll dis[100005], disS[100005], disU[100005], disV[100005];
bool visited[100005];
priority_queue <pair<long long,int>, vector<pair<long long,int> >, greater<pair<long long, int> > > pq;
void dijkstra(int root){
fill(dis+1,dis+n+1, (ll) 1e18);
fill(visited,visited+n+1,0);
dis[root] = 0;
pq.push(pair<ll,int>(0ll, root));
while(pq.size()){
int u = pq.top().second;
pq.pop();
if (visited[u]) continue;
visited[u] = 1;
for(auto v: G[u]){
if (dis[v.v] > dis[u] + v.w)
dis[v.v] = dis[u] + v.w,
pq.push(pair<ll,int>(dis[v.v], v.v));
}
}
}
# | 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... |