#include "citymapping.h"
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
using ll = long long;
ll get(int a, int b) {
return get_distance(a, b);
}
void find_roads(int n, int q, int a[], int b[], int w[]) {
vector <int> dist[n+5];
int pt = 0;
for (int i = 2; i <= n; i++) {
ll x = get(1, i);
if (x == 1) {
a[pt] = 1, b[pt] = i;
pt++;
}
dist[x].pb(i);
}
for (int i = 1; i < n; i++) {
if (dist[i].size() == 0 || dist[i+1].size() == 0) continue;
for (auto& el : dist[i])
for (auto& el1 : dist[i+1]) {
ll x = get(el, el1);
if (x == 1) {
a[pt] = el, b[pt] = el1;
pt++;
}
}
}
return;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
600 KB |
Reported list of edges differ from actual. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
600 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 |
2 ms |
468 KB |
Reported list of edges differ from actual. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
600 KB |
Reported list of edges differ from actual. |
2 |
Halted |
0 ms |
0 KB |
- |