제출 #979461

#제출 시각아이디문제언어결과실행 시간메모리
979461HappyCapybara사이버랜드 (APIO23_cyberland)C++17
15 / 100
27 ms6748 KiB
#include "cyberland.h" #include<bits/stdc++.h> using namespace std; double solve(int N, int M, int K, int H, vector<int> x, vector<int> y, vector<int> c, vector<int> arr){ vector<vector<pair<int,int>>> g(N); for (int i=0; i<M; i++){ g[x[i]].push_back({y[i], c[i]}); g[y[i]].push_back({x[i], c[i]}); } vector<bool> seen(N, false); priority_queue<pair<double,int>> pq; pq.push({(double) 0, 0}); while (!pq.empty()){ double d = -pq.top().first; int cur = pq.top().second; pq.pop(); if (cur == H) return d; if (seen[cur]) continue; seen[cur] = true; for (pair<int,int> next : g[cur]) pq.push({-(d+next.second), next.first}); } return -1; }
#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...