제출 #710714

#제출 시각아이디문제언어결과실행 시간메모리
710714mdubBitaro the Brave (JOI19_ho_t1)C++14
0 / 100
1 ms304 KiB
#include <bits/stdc++.h> using namespace std; int main () { int n, m; cin >> n >> m; vector<string> grid(n); for (int i = 0; i < n; i++) { cin >> grid[i]; } vector<int> occsCols(m, 0); vector<int> occsLins(n, 0); for (int y = 0; y < n; y++) { for (int x = 0; x < m; x++) { if (grid[y][x] == 'O') occsLins[y]++; } } for (int x = 0; x < m; x++) { for (int y = 0; y < n; y++) { if (grid[y][x] == 'I') occsCols[x]++; } } long long ans = 0; for (int y = 0; y < n; y++) { for (int x = 0; x < m; x++) { if (grid[y][x] == 'J') { ans += occsCols[x] * occsLins[y]; } } }cout << ans << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...