# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
48436 | aleksami | Commuter Pass (JOI18_commuter_pass) | C++14 | 548 ms | 75916 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;
typedef long long ll;
#define MAXN 100005
#define INF 1000000000000000
typedef pair<ll,ll> pii;
vector <pii> g[MAXN];
bool gotov[MAXN];
priority_queue <pii> pq;
int n,m;
void dijkstra(ll *d,int source)
{
for(int i = 0; i < MAXN; i++)d[i]=INF,gotov[i]=false;
d[source]=0;
pq.push({-d[source],source});
while(!pq.empty())
{
int v = pq.top().second;
pq.pop();
if(gotov[v])continue;
gotov[v]=1;
for(auto x:g[v])
{
int u = x.first;
int c = x.second;
if(d[u]>d[v]+c)d[u]=d[v]+c,pq.push({-d[u],u});
}
}
# | 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... |