제출 #706479

#제출 시각아이디문제언어결과실행 시간메모리
706479rainboyBitaro the Brave (JOI19_ho_t1)C11
100 / 100
227 ms88340 KiB
#include <stdio.h>

#define N	3000
#define M	3000

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

	scanf("%d%d", &n, &m);
	for (i = 0; i < n; i++)
		scanf("%s", cc[i]);
	for (i = 0; i < n; i++)
		for (j = m - 1, k = 0; j >= 0; j--) {
			if (cc[i][j] == 'O')
				k++;
			kko[i][j] = k;
		}
	for (j = 0; j < m; j++)
		for (i = n - 1, k = 0; i >= 0; i--) {
			if (cc[i][j] == 'I')
				k++;
			kki[i][j] = k;
		}
	ans = 0;
	for (i = 0; i < n; i++)
		for (j = 0; j < m; j++)
			if (cc[i][j] == 'J')
				ans += kko[i][j] * kki[i][j];
	printf("%lld\n", ans);
	return 0;
}

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

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