#include "citymapping.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void find_roads(int N, int Q, int A[], int B[], int W[]) {
int x = -1;
ll mx = 0;
for (int i = 1; i < N; i++) {
ll s = get_distance(1, i + 1);
if (s > mx) {
mx = s;
x = i;
}
}
vector<pair<ll, int>> p(N);
for (int i = 0; i < N; i++) {
p[i] = {get_distance(x + 1, i + 1), i};
}
sort(p.begin(), p.end());
for (int i = 0; i < N - 1; i++) {
A[i] = p[i].second + 1;
B[i] = p[i + 1].second + 1;
W[i] = p[i + 1].first - p[i].first;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
468 KB |
Correct: 1997 out of 500000 queries used. |
2 |
Incorrect |
1 ms |
468 KB |
Reported list of edges differ from actual. |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
468 KB |
Correct: 1997 out of 500000 queries used. |
2 |
Incorrect |
1 ms |
468 KB |
Reported list of edges differ from actual. |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
468 KB |
Correct: 1981 out of 12000 queries used. |
2 |
Correct |
1 ms |
468 KB |
Correct: 1985 out of 12000 queries used. |
3 |
Correct |
1 ms |
468 KB |
Correct: 1999 out of 12000 queries used. |
4 |
Correct |
1 ms |
468 KB |
Correct: 1985 out of 12000 queries used. |
5 |
Correct |
2 ms |
468 KB |
Correct: 1981 out of 12000 queries used. |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
468 KB |
Correct: 1981 out of 12000 queries used. |
2 |
Correct |
1 ms |
468 KB |
Correct: 1985 out of 12000 queries used. |
3 |
Correct |
1 ms |
468 KB |
Correct: 1999 out of 12000 queries used. |
4 |
Correct |
1 ms |
468 KB |
Correct: 1985 out of 12000 queries used. |
5 |
Correct |
2 ms |
468 KB |
Correct: 1981 out of 12000 queries used. |
6 |
Correct |
1 ms |
468 KB |
Correct: 1995 out of 12000 queries used. |
7 |
Correct |
1 ms |
468 KB |
Correct: 1991 out of 12000 queries used. |
8 |
Correct |
2 ms |
476 KB |
Correct: 1999 out of 12000 queries used. |
9 |
Correct |
2 ms |
468 KB |
Correct: 1993 out of 12000 queries used. |
10 |
Correct |
2 ms |
472 KB |
Correct: 1987 out of 12000 queries used. |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
468 KB |
Correct: 1997 out of 500000 queries used. |
2 |
Incorrect |
1 ms |
468 KB |
Reported list of edges differ from actual. |
3 |
Halted |
0 ms |
0 KB |
- |