답안 #307320

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
307320 2020-09-27T18:50:21 Z Temmie Bitaro the Brave (JOI19_ho_t1) C++17
0 / 100
278 ms 274436 KB
#include <bits/stdc++.h>

typedef long long ll;

int main() {
	std::ios::sync_with_stdio(0);
	
	int h, w; std::cin >> h >> w;
	std::vector <std::vector <char>> g(3001, std::vector <char> (3001));
	std::vector <std::vector <std::vector <ll>>> a(3001, std::vector <std::vector <ll>> (3001, std::vector <ll> (2, 0))), b(a);
	for (int i = 1; i <= h; i++)
		for (int j = 1; j <= w; j++) {
			std::cin >> g[i][j];
			for (int k = 0; k < 2; k++) {
				a[i][j][k] = a[i][j - 1][k];
				b[i][j][k] = b[i - 1][j][k];
			}
			a[i][j][0] += g[i][j] == 'O';
			b[i][j][0] += g[i][j] == 'O';
			a[i][j][1] += g[i][j] == 'I';
			b[i][j][1] += g[i][j] == 'I';
		}
	ll ans = 0;
	for (int i = 1; i <= h; i++)
		for (int j = 1; j <= w; j++)
			if (g[i][j] == 'J')
				ans += (a[i][w][0] - a[i][j][0]) * (b[h][j][1] - b[i][j][1]);
	std::cout << ans << "\n";
	
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 278 ms 274436 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 278 ms 274436 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 278 ms 274436 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -