제출 #471555

#제출 시각아이디문제언어결과실행 시간메모리
471555rainboySažetak (COCI17_sazetak)C11
64 / 160
24 ms10260 KiB
#include <stdio.h>

#define N	5000000

int main() {
	static char marked[N];
	int n, m, i, k, ans;

	scanf("%d%d", &n, &m);
	while (m--) {
		scanf("%d", &k);
		for (i = k; i < n; i += k)
			marked[i] = 1;
	}
	ans = 0;
	for (i = 0; i < n; i++)
		if (marked[i] && (i + 1 == n || marked[i + 1]))
			ans++;
	printf("%d\n", ans);
	return 0;
}

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

sazetak.c: In function 'main':
sazetak.c:9:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |  scanf("%d%d", &n, &m);
      |  ^~~~~~~~~~~~~~~~~~~~~
sazetak.c:11:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |   scanf("%d", &k);
      |   ^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...