Submission #836216

# Submission time Handle Problem Language Result Execution time Memory
836216 2023-08-24T08:53:54 Z unnick City Mapping (NOI18_citymapping) C++14
0 / 100
2 ms 512 KB
#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]];
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 468 KB Reported list of edges differ from actual.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 468 KB Reported list of edges differ from actual.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 512 KB Reported list of edges differ from actual.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 512 KB Reported list of edges differ from actual.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 468 KB Reported list of edges differ from actual.
2 Halted 0 ms 0 KB -