Submission #591292

# Submission time Handle Problem Language Result Execution time Memory
591292 2022-07-07T08:43:16 Z piOOE Bitaro the Brave (JOI19_ho_t1) C++17
0 / 100
0 ms 212 KB
#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];
    }
    long long ans = 0;
    for (int i = n - 1; i > -1; --i) {
        for (int j = m - 1; j > 0;  --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 time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -