Submission #558647

# Submission time Handle Problem Language Result Execution time Memory
558647 2022-05-07T20:14:46 Z Olympia Bitaro the Brave (JOI19_ho_t1) C++17
0 / 100
1 ms 212 KB
#include <bits/stdc++.h>
using namespace std;
int main() {
    int H, W;
    cin >> H >> W;
    string arr[H];
    for (int i = 0; i < H; i++) {
        cin >> arr[i];
    }
    int o[H][W + 1];
    for (int i = 0; i < H; i++) {
        o[i][0] = 0;
        for (int j = 0; j < W; j++) {
            o[i][j + 1] = o[i][j] + (arr[i][j] == 'O');
        }
    }
    int x[W][H + 1];
    for (int i = 0; i < W; i++) {
        x[i][0] = 0;
        for (int j = 0; j < H; j++) {
            x[i][j + 1] = x[i][j] + (arr[j][i] == 'I');
        }
    }
    int ans = 0;
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            if (arr[i][j] && x[j] && o[i]) {
                cout << i << " " << j << '\n';
                assert(o[i][W] >= o[i][j]);
                ans += (arr[i][j] == 'J') * (o[i][W] - o[i][j]) * (x[j][H] - x[j][i]);
            }
        }
    }
    cout << ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -