#include "citymapping.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1010;
int dis[N][N];
int n;
int d(int i, int j) {
if (i == j) return 0;
if (!dis[i][j]) return dis[i][j] = dis[j][i] = get_distance(i, j);
return dis[i][j];
}
void find_roads(int NN, int Q, int A[], int B[], int W[]) {
n = NN;
int mx = 0, idx = 0;
for (int i = 2;i <= n;i++) {
if (d(1, i) > mx) {
mx = d(1, i);
idx = i;
}
}
vector<pair<int, int>> v;
for (int i = 1;i <= n;i++) {
v.push_back({ d(idx, i), i });
}
sort(v.begin(), v.end());
int tot = 0;
for (int i = 1;i < n;i++) {
A[tot] = v[i - 1].second;
B[tot] = v[i].second;
W[tot] = v[i].first - v[i - 1].first;
tot++;
}
return;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4444 KB |
Correct: 1995 out of 500000 queries used. |
2 |
Incorrect |
2 ms |
4444 KB |
Reported list of edges differ from actual. |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4444 KB |
Correct: 1995 out of 500000 queries used. |
2 |
Incorrect |
2 ms |
4444 KB |
Reported list of edges differ from actual. |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4440 KB |
Correct: 1979 out of 12000 queries used. |
2 |
Correct |
2 ms |
4444 KB |
Correct: 1983 out of 12000 queries used. |
3 |
Correct |
1 ms |
4444 KB |
Correct: 1997 out of 12000 queries used. |
4 |
Correct |
2 ms |
4444 KB |
Correct: 1983 out of 12000 queries used. |
5 |
Correct |
2 ms |
4444 KB |
Correct: 1979 out of 12000 queries used. |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4440 KB |
Correct: 1979 out of 12000 queries used. |
2 |
Correct |
2 ms |
4444 KB |
Correct: 1983 out of 12000 queries used. |
3 |
Correct |
1 ms |
4444 KB |
Correct: 1997 out of 12000 queries used. |
4 |
Correct |
2 ms |
4444 KB |
Correct: 1983 out of 12000 queries used. |
5 |
Correct |
2 ms |
4444 KB |
Correct: 1979 out of 12000 queries used. |
6 |
Incorrect |
2 ms |
4444 KB |
Reported list of edges differ from actual. |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4444 KB |
Correct: 1995 out of 500000 queries used. |
2 |
Incorrect |
2 ms |
4444 KB |
Reported list of edges differ from actual. |
3 |
Halted |
0 ms |
0 KB |
- |