#include "network.h"
#include <bits/stdc++.h>
using namespace std;
#define MAXN 1003
int N, A, B;
int D[MAXN], E[MAXN];
void findRoute (int n, int a, int b)
{
N = n, A = a, B = b;
for (int i=1;i<=N;i++){
D[i] = (A == i ? 0 : ping(A, i) + 1);
E[i] = (B == i ? 0 : ping(B, i) + 1);
}
vector <int> arr;
for (int i=1;i<=N;i++) if (D[i]+E[i] == D[B]) arr.push_back(i);
sort(arr.begin(), arr.end(), [](const int &a, const int &b){
return D[a] < D[b];
});
for (int i=1;i<arr.size();i++) printf("%d\n", arr[i]);
for (int i=1;i<arr.size();i++) travelTo(arr[i]);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
OK |
93 ms |
5716 KB |
FAIL 잘못된 접근입니다 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
OK |
46 ms |
5716 KB |
FAIL 잘못된 접근입니다 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
OK |
68 ms |
5716 KB |
FAIL 잘못된 접근입니다 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
OK |
74 ms |
5716 KB |
FAIL 잘못된 접근입니다 |
2 |
Halted |
0 ms |
0 KB |
- |