# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
102275 | onjo0127 | Bitaro the Brave (JOI19_ho_t1) | C++11 | 809 ms | 18040 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 <bits/stdc++.h>
using namespace std;
char A[3009][3009];
int se[3009], ga[3009];
int main() {
int H, W; scanf("%d%d",&H,&W);
for(int i=1; i<=H; i++) {
for(int j=1; j<=W; j++) {
scanf(" %c",&A[i][j]);
}
}
long long ans = 0;
for(int i=H; i>=1; i--) {
for(int j=W; j>=1; j--) {
if(A[i][j] == 'J') ans += se[j] * ga[i];
if(A[i][j] == 'I') ++se[j];
if(A[i][j] == 'O') ++ga[i];
}
}
printf("%lld",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... |