이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#define ll long long
#include <bits/stdc++.h>
#include "cyberland.h"
using namespace std;
const ll N=1e5+9;
pair<ll,ll>p;
double ans=-1;
ll vis[N],dis[N];
vector<pair<ll,ll>>v[N];
priority_queue<pair<ll,ll>>q;
double solve(int N, int M, int K, int H, vector<int> x, vector<int> y, vector<int> c, vector<int> arr) {
for(auto &i:dis)i=1e18;
for(ll i=0;i<M;++i)
{
v[x[i]].push_back({c[i],y[i]});
v[y[i]].push_back({c[i],x[i]});
}
q.push({0,0});
while(q.size())
{
p=q.top();
q.pop();
if(vis[p.second])continue;
vis[p.second]=1;
for(auto i:v[p.second])
{
if(dis[p.second]+i.second<dis[i.first])
{
dis[i.first]=dis[p.second]+i.second;
q.push({-dis[p.second],i.first});
}
}
}
return ans;
}
# | 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... |
# | 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... |