#include "network.h"
#include <bits/stdc++.h>
using namespace std;
vector <int> arr[1001];
void findRoute (int N, int A, int B)
{
int dist = ping(A, B) + 1;
for (int i=1;i<=N;i++) if (B != i){
int d = ping(B, i) + 1;
if (d >= dist) continue;
arr[dist-d].push_back(i);
}
int p = A;
for (int i=1;i<dist;i++)
for (int t: arr[i])
if (!ping(p, t)){ travelTo(p = t); break; }
travelTo(B);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
121 ms |
5728 KB |
Output is correct |
2 |
Correct |
94 ms |
5728 KB |
Output is correct |
3 |
Correct |
109 ms |
5728 KB |
Output is correct |
4 |
Correct |
130 ms |
5728 KB |
Output is correct |
5 |
Correct |
118 ms |
5728 KB |
Output is correct |
6 |
Correct |
113 ms |
5728 KB |
Output is correct |
7 |
Correct |
0 ms |
5728 KB |
Output is correct |
8 |
Correct |
0 ms |
5728 KB |
Output is correct |
9 |
Correct |
0 ms |
5728 KB |
Output is correct |
10 |
Correct |
0 ms |
5728 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
116 ms |
5728 KB |
Output is correct |
2 |
Correct |
20 ms |
5728 KB |
Output is correct |
3 |
Correct |
130 ms |
5728 KB |
Output is correct |
4 |
Correct |
96 ms |
5728 KB |
Output is correct |
5 |
Correct |
131 ms |
5728 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
92 ms |
5728 KB |
Output is correct |
2 |
Correct |
21 ms |
5728 KB |
Output is correct |
3 |
Correct |
165 ms |
5728 KB |
Output is correct |
4 |
Correct |
69 ms |
5728 KB |
Output is correct |
5 |
Correct |
142 ms |
5728 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
104 ms |
5728 KB |
Output is correct |
2 |
Correct |
25 ms |
5728 KB |
Output is correct |
3 |
Correct |
117 ms |
5728 KB |
Output is correct |
4 |
Correct |
79 ms |
5728 KB |
Output is correct |
5 |
Correct |
118 ms |
5728 KB |
Output is correct |