Submission #1126235

#TimeUsernameProblemLanguageResultExecution timeMemory
1126235psm9352Cyberland (APIO23_cyberland)C++20
0 / 100
1395 ms2162688 KiB
#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]; if (arr[x[i]]==0){adj[y[i]][x[i]]=0;} if (arr[x[i]]==2){adj[y[i]][x[i]]/=2;} if (arr[y[i]]==0){adj[x[i]][y[i]]=0;} if (arr[y[i]]==2){adj[x[i]][y[i]]/=2;} } 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 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...