#include <vector>
#include <algorithm>
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<double> ans(3,1e18);ans[0]=0;
for (int t = 0;t<4;t++){
for (int i = 0;i<M;i++){
if (ans[x[i]]!=1e18) ans[y[i]]=min(ans[y[i]],ans[x[i]]+c[i]);
}
}
if (ans[H]>=1e18){return -1;}
return ans[H];
}
# | 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... |