#include "crocodile.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
const int N = 1e6;
int n, m;
vector<int> dist[N], dp(N);
vector<pair<int, int>> g[N];
bitset<N> is;
void dfs(int v, int p){
if(is[v]){
return;
}
for(auto k: g[v]){
int u = k.first, e = k.second;
if(u == p) continue;
dfs(u, v);
}
for(auto k: g[v]){
int u = k.first, e = k.second;
if(u == p) continue;
int dist = 1e9;
for(auto k1: g[v]){
int u1 = k1.first, e1 = k1.second;
if(u1 == p || u1 == u) continue;
dist = min(dist, dp[u1] + e1);
}
dp[v] = max(dp[v], dist);
}
}
int travel_plan(int F, int M, int R[][2], int L[], int K, int P[]){
n = F;
m = M;
for(int i = 0; i < K; ++i) is[P[i]] = 1;
for(int i = 0; i < m; ++i){
g[R[i][0]].pb({R[i][1], L[i]});
g[R[i][1]].pb({R[i][0], L[i]});
}
dfs(0, 0);
return dp[0];
}
int main(){
return 0;
}
Compilation message
crocodile.cpp: In function 'void dfs(int, int)':
crocodile.cpp:19:26: warning: unused variable 'e' [-Wunused-variable]
19 | int u = k.first, e = k.second;
| ^
crocodile.cpp:24:26: warning: unused variable 'e' [-Wunused-variable]
24 | int u = k.first, e = k.second;
| ^
/usr/bin/ld: /tmp/ccCT3rO5.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccgLK7r5.o:crocodile.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status