Submission #976680

#TimeUsernameProblemLanguageResultExecution timeMemory
976680IzazCyberland (APIO23_cyberland)C++17
0 / 100
2031 ms2097152 KiB
#include <bits/stdc++.h> using namespace std; #define f first #define s second #define mn(a,b) min(a,b) #define mx(a,b) max(a,b) #define ll long long vector<pair<int,int>>G[int(1e5)]; double My_Num = 0; int ok = 0 ; void dfs(int x,int p,int h){ if(x == h){ ok = 1; return; } for(auto u : G[x]){ if(u.f==p)continue; My_Num+=u.s; dfs(u.f,x,h); if(ok)return; My_Num-=u.s; } } double solve(int N, int M, int K, int H, std::vector<int> x, std::vector<int> y, std::vector<int> c, std::vector<int> arr){ for(int i = 0 ; i < M ;i++){ G[x[i]].push_back({y[i],c[i]}); G[y[i]].push_back({x[i],c[i]}); } dfs(0,-1,H); return My_Num; }
#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...