제출 #970595

#제출 시각아이디문제언어결과실행 시간메모리
970595SuPythony사이버랜드 (APIO23_cyberland)C++17
0 / 100
1027 ms2097152 KiB
#include "cyberland.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; vector<vector<pair<int,int>>> al; double ans; void dfs(int i, int p, double c, vector<int> a) { if (i==0) { ans=min(ans,c); return; } if (a[i]==0) { ans=min(ans,c); c=0; } for (auto v: al[i]) { if (v.first==p) continue; dfs(v.first,i,v.second+c,a); } } double solve(int N, int M, int K, int H, vector<int> x, vector<int> y, vector<int> c, vector<int> a) { ans=1e9; al.assign(N,vector<pair<int,int>>()); for (int i=0; i<M; i++) { al[x[i]].push_back({y[i],(double)c[i]}); al[y[i]].push_back({x[i],(double)c[i]}); } dfs(H,-1,0,a); 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...