제출 #481400

#제출 시각아이디문제언어결과실행 시간메모리
481400rainboySpiderman (COCI20_spiderman)C11
56 / 70
100 ms12128 KiB
#include <stdio.h>

#define N	300000
#define A	1000000

int main() {
	static int aa[N], kk[A + 1], ans[A + 1];
	int n, r, i, a, b;

	scanf("%d%d", &n, &r);
	for (i = 0; i < n; i++) {
		scanf("%d", &aa[i]);
		kk[aa[i]]++;
	}
	for (a = r + 1; a <= A; a++)
		for (b = r; b <= A; b += a)
			ans[b] += kk[a];
	for (i = 0; i < n; i++)
		printf("%d ", ans[aa[i]]);
	printf("\n");
	return 0;
}

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

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