This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |