# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
99003 | kriii | Bitaro the Brave (JOI19_ho_t1) | C++17 | 164 ms | 80488 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>
int H,W; char S[3030][3030]; int A[3030][3030],B[3030][3030];
int main()
{
scanf ("%d %d",&H,&W);
for (int i=0;i<H;i++) scanf ("%s",S[i]);
long long ans = 0;
for (int i=H-1;i>=0;i--) for (int j=W-1;j>=0;j--){
A[i][j] = A[i+1][j];
B[i][j] = B[i][j+1];
if (S[i][j] == 'I') A[i][j]++;
if (S[i][j] == 'O') B[i][j]++;
if (S[i][j] == 'J') ans += (long long) A[i][j] * B[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... |