# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
335617 | Joshc | Bitaro the Brave (JOI19_ho_t1) | C++11 | 905 ms | 88704 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 <cstdio>
using namespace std;
char c[3002][3002];
int a[3002][3002], b[3002][3002];
int main() {
int h, w;
long long ans = 0;
scanf("%d%d", &h, &w);
for (int i=1; i<=h; i++) {
for (int j=1; j<=w; j++) scanf(" %c", &c[i][j]);
for (int j=w; j>0; j--) a[i][j] = a[i][j+1]+(c[i][j]=='O');
}
for (int j=1; j<=w; j++) {
for (int i=h; i>0; i--) {
b[i][j] = b[i+1][j]+(c[i][j]=='I');
ans += (c[i][j]=='J')*a[i][j]*b[i][j];
}
}
printf("%lld\n", ans);
}
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... |