제출 #705545

#제출 시각아이디문제언어결과실행 시간메모리
705545rainboyDango Maker (JOI18_dango_maker)C11
13 / 100
1 ms296 KiB
#include <stdio.h>

#define N	3000
#define M	3000

int main() {
	static char cc[N][M + 1];
	int n, m, i, j, k;

	scanf("%d%d", &n, &m);
	for (i = 0; i < n; i++)
		scanf("%s", cc[i]);
	k = 0;
	for (i = 0; i < n; i++)
		for (j = 0; j < m; j++)
			if (j + 2 < m && cc[i][j] == 'R' && cc[i][j + 1] == 'G' && cc[i][j + 2] == 'W')
				cc[i][j] = cc[i][j + 1] = cc[i][j + 2] = '-', k++;
			else if (i + 2 < n && cc[i][j] == 'R' && cc[i + 1][j] == 'G' && cc[i + 2][j] == 'W')
				cc[i][j] = cc[i + 1][j] = cc[i + 2][j] = '|', k++;
	printf("%d\n", k);
	return 0;
}

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

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