Submission #321576

# Submission time Handle Problem Language Result Execution time Memory
321576 2020-11-12T19:12:05 Z wind_reaper City Mapping (NOI18_citymapping) C++17
0 / 100
4 ms 6380 KB
#include "citymapping.h"
#include <bits/stdc++.h>

using namespace std;
const long long INF = 1e18;
void find_roads(int N, int Q, int A[], int B[], int W[]) {
	long long dis[N+1][N+1];
	for(int i = 0; i <= N; i++)
		dis[i][i] = INF;
	int f = 0, cur = 1;
	vector<bool> seen(N+1);
	seen[1] = 1;
	while(f < N){
		for(int i = 1; i <= N; i++){
			if(seen[i]) continue;
			dis[cur][i] = dis[i][cur] = get_distance(i, cur);
		}
		A[f] = cur, B[f] = distance(dis[cur], min_element(dis[cur]+1, dis[cur]+N+1)), W[f] = dis[A[f]][B[f]];
		f++;
		cur = B[f];
		seen[cur] = 1;
	}
	return;
}
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 6380 KB get_distance() arguments out of range.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 6380 KB get_distance() arguments out of range.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 6380 KB get_distance() arguments out of range.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 6380 KB get_distance() arguments out of range.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 6380 KB get_distance() arguments out of range.
2 Halted 0 ms 0 KB -