Submission #976486

#TimeUsernameProblemLanguageResultExecution timeMemory
976486NexusCyberland (APIO23_cyberland)C++17
0 / 100
28 ms15868 KiB
#define ll long long #include <bits/stdc++.h> #include "cyberland.h" using namespace std; const ll N=1e5+9; ll vis[N]; pair<ll,ll>p; double ans=-1; 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(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; if(p.second==H)ans=p.first; if(!arr[p.second])p.first=0; for(auto i:v[p.second]) q.push({p.first+i.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...