제출 #1356047

#제출 시각아이디문제언어결과실행 시간메모리
1356047ChinguunBitaro the Brave (JOI19_ho_t1)C++20
0 / 100
0 ms348 KiB
#include <bits/stdc++.h>
using namespace std;

#define int long long
#define ff first
#define ss second
#define pb push_back
#define ppb pop_back
#define meta int tm = (tl + tr) / 2, x = i * 2 + 1, y = x + 1

const int SN = 3007;
const int TN = 4 * SN;
const int oo = 1e18;
const int mod = 1e9 + 7;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vii;

int n, m, x[SN], y[SN], ans;
char a[SN][SN];

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	cin >> n >> m;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= m; j++) {
			cin >> a[i][j];
			if (a[i][j] == 'O' && j > i) x[i]++;
			if (a[i][j] == 'I' && i > j) y[j]++;
		}
	}
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= m; j++) {
			if (a[i][j] == 'J') {
				ans += x[i] * y[j];
			}
		}
	}
	cout << ans;
	return 0;
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…