Submission #976597

#TimeUsernameProblemLanguageResultExecution timeMemory
976597NexusCyberland (APIO23_cyberland)C++17
0 / 100
327 ms16944 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...