#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)
A[Dist-ping(i,b)].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);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
112 ms |
5220 KB |
Output is correct |
2 |
Runtime error |
108 ms |
5216 KB |
Program hung waiting for input |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
120 ms |
5220 KB |
Output is correct |
2 |
Correct |
32 ms |
5220 KB |
Output is correct |
3 |
Correct |
116 ms |
5220 KB |
Output is correct |
4 |
Runtime error |
104 ms |
5216 KB |
SIGSEGV Segmentation fault |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
108 ms |
5220 KB |
Output is correct |
2 |
Correct |
24 ms |
5220 KB |
Output is correct |
3 |
Correct |
116 ms |
5220 KB |
Output is correct |
4 |
Runtime error |
96 ms |
5216 KB |
SIGSEGV Segmentation fault |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
112 ms |
5220 KB |
Output is correct |
2 |
Correct |
28 ms |
5220 KB |
Output is correct |
3 |
Correct |
112 ms |
5220 KB |
Output is correct |
4 |
Runtime error |
100 ms |
5216 KB |
SIGSEGV Segmentation fault |
5 |
Halted |
0 ms |
0 KB |
- |