제출 #591291

#제출 시각아이디문제언어결과실행 시간메모리
591291piOOEBitaro the Brave (JOI19_ho_t1)C++17
100 / 100
149 ms11164 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, m; cin >> n >> m; vector<int> I(m), O(n); vector<string> s(n); for (int i = 0; i < n; ++i) { cin >> s[i]; for (int j = 0; j < m; ++j) { if (s[i][j] == 'I') { ++I[j]; } else if (s[i][j] == 'O') { ++O[i]; } } } long long ans = 0; for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { if (s[i][j] == 'I') { --I[j]; } else if (s[i][j] == 'O') { --O[i]; } else { ans += I[j] * 1ll * O[i]; } } } cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...