#include "network.h"
const int MAX_N = 1000;
void findRoute (int N, int a, int b)
{
int db[MAX_N], i, x = a;
for (i = 0; i < N; i++) db[i] = (i+1 == b) ? 0 : (ping(i+1, b) + 1);
while (db[x-1]) {
for (i = 0; i < N; i++)
if (db[i] == db[x-1] - 1 && ping(i+1, x) == 0) {
x = i+1;
travelTo (x);
break;
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
112 ms |
5072 KB |
Output is correct |
2 |
Correct |
112 ms |
5072 KB |
Output is correct |
3 |
Correct |
100 ms |
5072 KB |
Output is correct |
4 |
Correct |
112 ms |
5072 KB |
Output is correct |
5 |
Correct |
108 ms |
5072 KB |
Output is correct |
6 |
Correct |
92 ms |
5072 KB |
Output is correct |
7 |
Correct |
0 ms |
5072 KB |
Output is correct |
8 |
Correct |
0 ms |
5072 KB |
Output is correct |
9 |
Correct |
0 ms |
5072 KB |
Output is correct |
10 |
Correct |
0 ms |
5072 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
108 ms |
5072 KB |
Output is correct |
2 |
Correct |
24 ms |
5072 KB |
Output is correct |
3 |
Correct |
116 ms |
5072 KB |
Output is correct |
4 |
Correct |
104 ms |
5072 KB |
Output is correct |
5 |
Correct |
124 ms |
5072 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
108 ms |
5072 KB |
Output is correct |
2 |
Correct |
28 ms |
5072 KB |
Output is correct |
3 |
Correct |
112 ms |
5072 KB |
Output is correct |
4 |
Correct |
104 ms |
5072 KB |
Output is correct |
5 |
Correct |
120 ms |
5072 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
116 ms |
5072 KB |
Output is correct |
2 |
Correct |
28 ms |
5072 KB |
Output is correct |
3 |
Correct |
116 ms |
5072 KB |
Output is correct |
4 |
Correct |
96 ms |
5072 KB |
Output is correct |
5 |
Correct |
124 ms |
5072 KB |
Output is correct |