# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
165140 | Akashi | Bitaro the Brave (JOI19_ho_t1) | C++14 | 152 ms | 88504 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;
int n, m;
char s[3005][3005];
int l[3005][3005], c[3005][3005];
int main()
{
// freopen("1.in", "r", stdin);
scanf("%d%d", &n, &m);
for(int i = 1; i <= n ; ++i) scanf("%s", s[i] + 1);
long long Sol = 0;
for(int i = n; i >= 1 ; --i){
for(int j = m; j >= 1 ; --j){
c[i][j] = c[i][j + 1] + (s[i][j] == 'O');
l[i][j] = l[i + 1][j] + (s[i][j] == 'I');
if(s[i][j] == 'J') Sol = Sol + 1LL * l[i][j] * c[i][j];
}
}
printf("%lld", Sol);
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... |