Submission #16779

#TimeUsernameProblemLanguageResultExecution timeMemory
16779kdh9949Computer Network (BOI14_network)C++98
25 / 100
134 ms5588 KiB
#include "network.h" #include <vector> #include <stack> using namespace std; vector<int> d[1010]; stack<int> ans; void findRoute (int N, int a, int b) { int cur,dist,last; for(int i=1;i<=N;i++){ if(i==a)continue; cur=ping(a,i); if(i==b)dist=cur; d[cur].push_back(i); } last=b; for(int i=dist-1;i>=0;i--){ for(int j=0;j<d[i].size();j++){ if(ping(last,d[i][j])==0){ ans.push(last); last=d[i][j]; } } } ans.push(last); while(!ans.empty())travelTo(ans.top()),ans.pop(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...