# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1167742 | wstcube | Commuter Pass (JOI18_commuter_pass) | C++20 | 219 ms | 19464 KiB |
#include <bits/stdc++.h>
//#pragma GCC optimize(O3,unroll-loops)
//#pragma GCC target(avx2,bmi,bmi2,popcnt,lzcnt)
#define ll long long
#define fi first
#define se second
#define pb push_back
const ll INF = 1e18;
using namespace std;
ll n,m;
void dijkstra(vector<ll>& d,ll s, vector<vector<pair<ll,ll> > >& adj){
d.assign(n,INF);
d[s]=0;
priority_queue<pair<ll,ll>,vector<pair<ll,ll> >, greater<pair<ll,ll> > > q;
q.push({0,s});
while(!q.empty()){
ll v =q.top().se;
ll d_v = q.top().fi;
q.pop();
if(d[v]!=d_v)
continue;
for(auto edge : adj[v]){
ll to = edge.fi;
ll len = edge.se;
if(d[v] + len <d[to]){
d[to] = d[v]+len;
q.push({d[to],to});
}
}
}
# | 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... |