#include "network.h"
#include <vector>
using namespace std;
vector<int> lis[1100];
void findRoute (int N, int a, int b) {
int dist = ping(a, b)+1, i, j;
for (i=1;i<=N;i++) {
if (i==a||i==b) continue;
int tmp = ping(i,b);
lis[tmp+1].push_back(i);
}
int here = a;
for (i=dist-1;i>0;i--) {
for (j=0;j<lis[i].size();j++) {
if (ping(here,lis[i][j])==0) {
travelTo(lis[i][j]);
here=lis[i][j];
break;
}
}
}
travelTo(b);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
5220 KB |
Output is correct |
2 |
Correct |
107 ms |
5220 KB |
Output is correct |
3 |
Correct |
130 ms |
5220 KB |
Output is correct |
4 |
Correct |
112 ms |
5220 KB |
Output is correct |
5 |
Correct |
103 ms |
5220 KB |
Output is correct |
6 |
Correct |
72 ms |
5220 KB |
Output is correct |
7 |
Correct |
0 ms |
5220 KB |
Output is correct |
8 |
Correct |
0 ms |
5220 KB |
Output is correct |
9 |
Correct |
0 ms |
5220 KB |
Output is correct |
10 |
Correct |
0 ms |
5220 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
101 ms |
5220 KB |
Output is correct |
2 |
Correct |
10 ms |
5220 KB |
Output is correct |
3 |
Correct |
0 ms |
5220 KB |
Output is correct |
4 |
Correct |
76 ms |
5220 KB |
Output is correct |
5 |
Correct |
119 ms |
5220 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
66 ms |
5220 KB |
Output is correct |
2 |
Correct |
24 ms |
5220 KB |
Output is correct |
3 |
Correct |
0 ms |
5220 KB |
Output is correct |
4 |
Correct |
83 ms |
5220 KB |
Output is correct |
5 |
Correct |
124 ms |
5220 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
38 ms |
5220 KB |
Output is correct |
2 |
Correct |
29 ms |
5220 KB |
Output is correct |
3 |
Correct |
146 ms |
5220 KB |
Output is correct |
4 |
Correct |
103 ms |
5220 KB |
Output is correct |
5 |
Correct |
121 ms |
5220 KB |
Output is correct |