Submission #308816

#TimeUsernameProblemLanguageResultExecution timeMemory
308816juggernautCrocodile's Underground City (IOI11_crocodile)C++14
46 / 100
190 ms262148 KiB
#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[p[i]]=1; return dfs(0,0); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...