# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
706479 | rainboy | Bitaro the Brave (JOI19_ho_t1) | C11 | 227 ms | 88340 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdio.h>
#define N 3000
#define M 3000
int main() {
static char cc[N][M + 1];
static int kko[N][M], kki[N][M];
int n, m, i, j, k;
long long ans;
scanf("%d%d", &n, &m);
for (i = 0; i < n; i++)
scanf("%s", cc[i]);
for (i = 0; i < n; i++)
for (j = m - 1, k = 0; j >= 0; j--) {
if (cc[i][j] == 'O')
k++;
kko[i][j] = k;
}
for (j = 0; j < m; j++)
for (i = n - 1, k = 0; i >= 0; i--) {
if (cc[i][j] == 'I')
k++;
kki[i][j] = k;
}
ans = 0;
for (i = 0; i < n; i++)
for (j = 0; j < m; j++)
if (cc[i][j] == 'J')
ans += kko[i][j] * kki[i][j];
printf("%lld\n", ans);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |