Submission #886272

# Submission time Handle Problem Language Result Execution time Memory
886272 2023-12-11T16:47:25 Z stefanneagu Bitaro the Brave (JOI19_ho_t1) C++17
0 / 100
0 ms 444 KB
#include <bits/stdc++.h>
using namespace std;
const int nmax = 1e3 + 1;
char mat[nmax][nmax];
int O[nmax], I[nmax];
int main() {
  int n, m;
  cin >> n >> m;
  for(int i = 1; i <= n; i ++) {
    for(int j = 1; j <= m; j ++) {
      cin >> mat[i][j];
      if(mat[i][j] == 'O') {
        O[i] ++;
      }
      if(mat[i][j] == 'I') {
        I[j] ++;
      }
    }
  }
  int ans = 0;
  for(int  i = 1; i <= n; i ++) {
    for(int j = 1; j <= n; j ++) {
      if(mat[i][j] == 'J') {
        ans += (long long) I[j] * O[i];
      }
    }
  }
  cout << ans;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 444 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 444 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 444 KB Output isn't correct
5 Halted 0 ms 0 KB -