제출 #381140

#제출 시각아이디문제언어결과실행 시간메모리
381140rainboy원 고르기 (APIO18_circle_selection)C11
7 / 100
3053 ms14228 KiB
#include <stdio.h>

#define N	300000

int main() {
	static int xx[N], yy[N], rr[N], pp[N];
	static char used[N];
	int n, i;

	scanf("%d", &n);
	for (i = 0; i < n; i++)
		scanf("%d%d%d", &xx[i], &yy[i], &rr[i]);
	while (1) {
		int i_;

		i_ = -1;
		for (i = 0; i < n; i++)
			if (!used[i] && (i_ == -1 || rr[i_] < rr[i]))
				i_ = i;
		if (i_ == -1)
			break;
		for (i = 0; i < n; i++) {
			long long x = xx[i] - xx[i_], y = yy[i] - yy[i_], r = rr[i] + rr[i_];

			if (!used[i] && x * x + y * y <= r * r)
				used[i] = 1, pp[i] = i_;
		}
	}
	for (i = 0; i < n; i++)
		printf("%d ", pp[i] + 1);
	printf("\n");
	return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

circle_selection.c: In function 'main':
circle_selection.c:10:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   10 |  scanf("%d", &n);
      |  ^~~~~~~~~~~~~~~
circle_selection.c:12:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   12 |   scanf("%d%d%d", &xx[i], &yy[i], &rr[i]);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...