#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) {
if (ping(a, j) == 0) {
a = j;
travelTo(j);
break;
}
}
}
}
travelTo(b);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
144 ms |
5076 KB |
Output is correct |
2 |
Incorrect |
51 ms |
5076 KB |
Output isn't correct - Travelling to nonadjacent computer |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
59 ms |
5076 KB |
Output is correct |
2 |
Incorrect |
20 ms |
5076 KB |
Output isn't correct - Travelling to nonadjacent computer |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
91 ms |
5076 KB |
Output is correct |
2 |
Incorrect |
28 ms |
5076 KB |
Output isn't correct - Travelling to nonadjacent computer |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
83 ms |
5076 KB |
Output is correct |
2 |
Incorrect |
26 ms |
5076 KB |
Output isn't correct - Travelling to nonadjacent computer |
3 |
Halted |
0 ms |
0 KB |
- |