#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(3e5)];
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 time |
Memory |
Grader output |
1 |
Incorrect |
16 ms |
8024 KB |
Wrong Answer. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2648 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1209 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
23 ms |
13380 KB |
Wrong Answer. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1203 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1214 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1232 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1250 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |