#include "network.h"
#include <vector>
using namespace std;
vector <int> A[1001];
int Dist;
void findRoute (int N, int a, int b)
{
int i, j, k;
Dist=ping(a,b);
for(i=1 ; i<=N ; i++)
if(i!=a && i!=b)
{
k=ping(i,b);
if(k<Dist)
A[Dist-k].push_back(i);
}
for(i=1 ; i<=Dist ; i++)
{
k=A[i].size();
for(j=0 ; j<k ; j++)
if(ping(a,A[i][j])==0)
{
travelTo(A[i][j]);
a=A[i][j];
break;
}
}
travelTo(b);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
116 ms |
5220 KB |
Output is correct |
2 |
Correct |
112 ms |
5220 KB |
Output is correct |
3 |
Correct |
100 ms |
5220 KB |
Output is correct |
4 |
Correct |
100 ms |
5220 KB |
Output is correct |
5 |
Correct |
92 ms |
5220 KB |
Output is correct |
6 |
Correct |
108 ms |
5220 KB |
Output is correct |
7 |
Correct |
0 ms |
5220 KB |
Output is correct |
8 |
Correct |
0 ms |
5220 KB |
Output is correct |
9 |
Correct |
0 ms |
5220 KB |
Output is correct |
10 |
Correct |
0 ms |
5220 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
108 ms |
5220 KB |
Output is correct |
2 |
Correct |
20 ms |
5220 KB |
Output is correct |
3 |
Correct |
116 ms |
5220 KB |
Output is correct |
4 |
Correct |
100 ms |
5220 KB |
Output is correct |
5 |
Correct |
116 ms |
5220 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
108 ms |
5220 KB |
Output is correct |
2 |
Correct |
28 ms |
5220 KB |
Output is correct |
3 |
Correct |
108 ms |
5220 KB |
Output is correct |
4 |
Correct |
104 ms |
5220 KB |
Output is correct |
5 |
Correct |
108 ms |
5220 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
104 ms |
5220 KB |
Output is correct |
2 |
Correct |
28 ms |
5220 KB |
Output is correct |
3 |
Correct |
108 ms |
5220 KB |
Output is correct |
4 |
Correct |
100 ms |
5220 KB |
Output is correct |
5 |
Correct |
112 ms |
5220 KB |
Output is correct |