제출 #1126246

#제출 시각아이디문제언어결과실행 시간메모리
1126246psm9352사이버랜드 (APIO23_cyberland)C++20
5 / 100
18 ms2116 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(3,vector<double>(3,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=1; if (H==1){mid=2;} 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...