Submission #308815

# Submission time Handle Problem Language Result Execution time Memory
308815 2020-10-02T03:49:51 Z juggernaut Crocodile's Underground City (IOI11_crocodile) C++14
0 / 100
1 ms 384 KB
#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);
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -