#include "network.h"
int d[2005];
void findRoute(int N, int a, int b) {
int dist = ping(a, b);
for (int i = 1; i <= N; i++) d[i] = 0;
for (int i = 1; i <= N; i++) {
if (i != a)
d[i] = ping(a, i) + 1;
}
for (int i = 1; i <= dist; i++) {
for (int j = 1; j <= N; j++) {
if (d[j] - d[a] == 1) {
int v = ping(j, b);
if (dist == v + d[a] + 1) {
a = j;
travelTo(j);
break;
}
}
}
}
travelTo(b);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
121 ms |
5076 KB |
Output is correct |
2 |
Correct |
55 ms |
5076 KB |
Output is correct |
3 |
Correct |
137 ms |
5076 KB |
Output is correct |
4 |
Correct |
96 ms |
5076 KB |
Output is correct |
5 |
Correct |
122 ms |
5076 KB |
Output is correct |
6 |
Correct |
57 ms |
5076 KB |
Output is correct |
7 |
Correct |
0 ms |
5076 KB |
Output is correct |
8 |
Correct |
0 ms |
5076 KB |
Output is correct |
9 |
Correct |
0 ms |
5076 KB |
Output is correct |
10 |
Correct |
0 ms |
5076 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
93 ms |
5076 KB |
Output isn't correct - Travelling to nonadjacent computer |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
106 ms |
5076 KB |
Output isn't correct - Travelling to nonadjacent computer |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
107 ms |
5076 KB |
Output isn't correct - Travelling to nonadjacent computer |
2 |
Halted |
0 ms |
0 KB |
- |