제출 #1231820

#제출 시각아이디문제언어결과실행 시간메모리
1231820antromancapBitaro the Brave (JOI19_ho_t1)C++20
100 / 100
94 ms9160 KiB
#include <bits/stdc++.h> using namespace std; const int N = 3003; int n, m, c[N]; char a[N][N]; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> n >> m; for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) cin >> a[i][j]; long long ans = 0; for (int i = n; i; i--) { int cur = 0; for (int j = m; j; j--) { c[j] += a[i][j] == 'I'; cur += a[i][j] == 'O'; if (a[i][j] == 'J') ans += c[j] * cur; } } cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...