# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
151420 | TadijaSebez | 날다람쥐 (JOI14_ho_t4) | C++11 | 283 ms | 17820 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;
#define ll long long
#define pb push_back
const int N=100050;
const ll inf=9e18;
int h[N],hi[N],n,m,X;
ll dist[N][2];
vector<pair<int,int>> E[N];
void Dijkstra()
{
hi[1]=X;
for(int i=2;i<=n;i++) dist[i][0]=dist[i][1]=inf;
dist[1][0]=0;dist[1][1]=X;
priority_queue<pair<ll,int>> pq;
pq.push({0,1});
pq.push({-X,-1});
while(pq.size())
{
int u=pq.top().second;
ll d=-pq.top().first;
pq.pop();
int t=u<0?1:0;
u=abs(u);
if(dist[u][t]!=d) continue;
int H;
if(t==1) H=0;
else H=hi[u];
for(auto e:E[u])
{
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... |