답안 #482824

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
482824 2021-10-26T13:13:42 Z rainboy Odašiljači (COCI20_odasiljaci) C
컴파일 오류
0 ms 0 KB
#include <math.h>
#include <stdio.h>
#include <string.h>

#define N	1000
#define INF	0x3f3f3f3f3f3f3f3fLL

long long min(long long a, long long b) { return a < b ? a : b; }
long long max(long long a, long long b) { return a > b ? a : b; }

int main() {
	static int xx[N], yy[N];
	static long long dd[N];
	int n, m, i;
	long long ans;

	scanf("%d", &n);
	for (i = 0; i < n; i++)
		scanf("%d%d", &xx[i], &yy[i]);
	ans = 0;
	memset(dd, 0x3f, n * sizeof *dd), dd[0] = 0;
	for (m = 1; m <= n; m++) {
		int i_ = -1;

		for (i = 0; i < n; i++)
			if (dd[i] != -1 && (i_ == -1 || dd[i_] > dd[i]))
				i_ = i;
		ans = max(ans, dd[i_]);
		dd[i_] = -1;
		for (i = 0; i < n; i++)
			dd[i] = min(dd[i], (long long) (xx[i] - xx[i_]) * (xx[i] - xx[i_]) + (long long) (yy[i] - yy[i_]) * (yy[i] - yy[i_]));
	}
	printf("%f\n", sqrt(ans) / 2);
	return 0;
}

Compilation message

odasiljaci.c: In function 'main':
odasiljaci.c:17:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |  scanf("%d", &n);
      |  ^~~~~~~~~~~~~~~
odasiljaci.c:19:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |   scanf("%d%d", &xx[i], &yy[i]);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/ccFoddpS.o: in function `main':
odasiljaci.c:(.text.startup+0x206): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status