#include <vector>
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<double>> adj(N,vector<double>(N,1e18));
for (int i = 0;i<M;i++){
adj[x[i]][y[i]]=c[i];
adj[y[i]][x[i]]=c[i];
}
int mid;
if (H==1){mid=2;}else{mid=1;}
double ans = min(adj[0][H],adj[0][mid]+adj[mid][H]);
if (ans==1e18){return -1;}
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... |