#include<vector>
#include "network.h"
#define MN 1000
using namespace std;
vector<int> A[MN+1];
int d[MN+1];
void findRoute(int N,int a,int b){
for(int i=1;i<=N;i++){
if(i!=b){
d[i]=ping(i,b)+1;
}
else{
d[i]=0;
}
A[d[i]].push_back(i);
}
while(a!=b){
for(auto n:A[d[a]-1]){
if(ping(a,n)==0){
travelTo(n);
a=n;
break;
}
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
100 ms |
5220 KB |
Output is correct |
2 |
Correct |
87 ms |
5220 KB |
Output is correct |
3 |
Correct |
103 ms |
5220 KB |
Output is correct |
4 |
Correct |
126 ms |
5220 KB |
Output is correct |
5 |
Correct |
76 ms |
5220 KB |
Output is correct |
6 |
Correct |
73 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 |
60 ms |
5220 KB |
Output is correct |
2 |
Correct |
31 ms |
5220 KB |
Output is correct |
3 |
Correct |
133 ms |
5220 KB |
Output is correct |
4 |
Correct |
79 ms |
5220 KB |
Output is correct |
5 |
Correct |
87 ms |
5220 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
77 ms |
5220 KB |
Output is correct |
2 |
Correct |
19 ms |
5220 KB |
Output is correct |
3 |
Correct |
119 ms |
5220 KB |
Output is correct |
4 |
Correct |
86 ms |
5220 KB |
Output is correct |
5 |
Correct |
161 ms |
5220 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
115 ms |
5220 KB |
Output is correct |
2 |
Correct |
17 ms |
5220 KB |
Output is correct |
3 |
Correct |
132 ms |
5220 KB |
Output is correct |
4 |
Correct |
94 ms |
5220 KB |
Output is correct |
5 |
Correct |
128 ms |
5220 KB |
Output is correct |