#include"crocodile.h"
#include<bits/stdc++.h>
#define fr first
#define sc second
using namespace std;
vector<pair<int,int>>g[1005];
bool vis[1005];
int dfs(int v,int p){
if(vis[v])return 0;
multiset<int>st;
for(auto to:g[v])
if(to.fr!=p)
st.insert(dfs(to.fr,v)+to.sc);
st.erase(st.begin());
return *st.begin();
}
int travel_plan(int n,int m,int r[][2],int l[],int k,int p[]){
for(int i=0;i<m;i++){
g[r[i][0]].push_back({r[i][1],l[i]});
g[r[i][1]].push_back({r[i][0],l[i]});
}
for(int i=0;i<k;i++)vis[i]=1;
return dfs(0,0);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |