#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();
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
5588 KB |
Output is correct |
2 |
Correct |
112 ms |
5588 KB |
Output is correct |
3 |
Correct |
32 ms |
5588 KB |
Output is correct |
4 |
Correct |
134 ms |
5588 KB |
Output is correct |
5 |
Correct |
100 ms |
5588 KB |
Output is correct |
6 |
Correct |
107 ms |
5588 KB |
Output is correct |
7 |
Correct |
0 ms |
5588 KB |
Output is correct |
8 |
Correct |
0 ms |
5588 KB |
Output is correct |
9 |
Correct |
0 ms |
5588 KB |
Output is correct |
10 |
Correct |
0 ms |
5588 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
89 ms |
5588 KB |
Output isn't correct - Route is too long |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
28 ms |
5588 KB |
Output isn't correct - Route is too long |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
73 ms |
5588 KB |
Output isn't correct - Route is too long |
2 |
Halted |
0 ms |
0 KB |
- |