Submission #848905

#TimeUsernameProblemLanguageResultExecution timeMemory
848905Mr_PhRace (IOI11_race)C++14
Compilation error
0 ms0 KiB
#include "race.h" #include "grader.cpp" #include<bits/stdc++.h> using namespace std; vector<int>vs; vector<int>vs1; vector<vector<pair<int,int>>>adj; int ans=1e9; int pog=0; void dfs(int node,int lol,int sum) { vs[node]=true; if(sum>pog) return; if(sum==pog) { ans=min(ans,lol); return; } for(auto i:adj[node]) { if(!vs[i.first]){ // cout<<node<<" "<<i.first<<" "<<i.second<<endl; dfs(i.first,lol+1,sum+i.second); } } } int best_path(int n, int k, int h[][2], int l[]) { pog=k; adj.resize(n+1); vs.resize(n+1); vs1=vs; for(int i=0;i<n-1;i++) { // cout<<h[i][0]<<" "<<h[i][1]<<" "<<l[i]<<endl; adj[h[i][0]].push_back({h[i][1],l[i]}); adj[h[i][1]].push_back({h[i][0],l[i]}); } for(int i=0;i<n;i++) { vs=vs1; dfs(i,0,0); //cout<<ans<<endl; } if(ans==1e9)ans=-1; return ans; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccAtFKQl.o: in function `read_input()':
race.cpp:(.text+0x150): multiple definition of `read_input()'; /tmp/ccv5cewm.o:grader.cpp:(.text+0x0): first defined here
/usr/bin/ld: /tmp/ccAtFKQl.o: in function `main':
race.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccv5cewm.o:grader.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status