#include "citymapping.h"
#include <algorithm>
#include <numeric>
#include <vector>
using namespace std;
#define ll long long
void find_roads(int N, int Q, int A[], int B[], int W[]) {
// vector<ll> dists(N*N);
vector<ll> dists(N);
dists[0] = 0;
vector<int> ids(N);
iota(ids.begin(), ids.end(), 0);
for (int i = 2; i <= N; i++) {
dists[i-1] = get_distance(1,i);
}
sort(ids.begin(), ids.end(), [&](int a, int b) {
return dists[a] < dists[b];
});
for (int i = 0; i < N-1; i++) {
A[i] = ids[i]+1;
B[i] = ids[i+1]+1;
W[i] = dists[ids[i+1]] - dists[ids[i]];
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
468 KB |
Reported list of edges differ from actual. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
468 KB |
Reported list of edges differ from actual. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
512 KB |
Reported list of edges differ from actual. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
512 KB |
Reported list of edges differ from actual. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
468 KB |
Reported list of edges differ from actual. |
2 |
Halted |
0 ms |
0 KB |
- |