#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 != b)
d[i] = ping(b, i) + 1;
}
for (int i = 1; i <= dist + 1; i++) {
for (int j = 1; j <= N; j++) {
if (d[j] - d[a] == -1) {
if (ping(a, j) == 0) {
a = j;
travelTo(j);
break;
}
}
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
154 ms |
5076 KB |
Output is correct |
2 |
Correct |
123 ms |
5076 KB |
Output is correct |
3 |
Correct |
66 ms |
5076 KB |
Output is correct |
4 |
Correct |
78 ms |
5076 KB |
Output is correct |
5 |
Correct |
99 ms |
5076 KB |
Output is correct |
6 |
Correct |
106 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 |
1 ms |
5076 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
59 ms |
5076 KB |
Output is correct |
2 |
Correct |
37 ms |
5076 KB |
Output is correct |
3 |
Correct |
119 ms |
5076 KB |
Output is correct |
4 |
Correct |
109 ms |
5076 KB |
Output is correct |
5 |
Correct |
142 ms |
5076 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
29 ms |
5076 KB |
Output is correct |
2 |
Correct |
29 ms |
5076 KB |
Output is correct |
3 |
Correct |
108 ms |
5076 KB |
Output is correct |
4 |
Correct |
62 ms |
5076 KB |
Output is correct |
5 |
Correct |
135 ms |
5076 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
86 ms |
5076 KB |
Output is correct |
2 |
Correct |
26 ms |
5076 KB |
Output is correct |
3 |
Correct |
167 ms |
5076 KB |
Output is correct |
4 |
Correct |
111 ms |
5076 KB |
Output is correct |
5 |
Correct |
114 ms |
5076 KB |
Output is correct |