제출 #392846

#제출 시각아이디문제언어결과실행 시간메모리
392846rainboyBaloni (COCI15_baloni)C11
100 / 100
97 ms3864 KiB
#include <stdio.h>

#define A	1000000

int main() {
	static int kk[A + 1];
	int n, ans;

	scanf("%d", &n);
	ans = n;
	while (n--) {
		int a;

		scanf("%d", &a);
		if (kk[a + 1] > 0)
			kk[a + 1]--, ans--;
		kk[a]++;
	}
	printf("%d\n", ans);
	return 0;
}

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

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