# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1023564 | vjudge1 | Bitaro the Brave (JOI19_ho_t1) | C++17 | 8 ms | 12632 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;
#define ll long long
#define fi first
#define se second
int h,w,rw[3001][3001],cl[3001][3001],tong;
char a[3001][3001];
main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL);
cin>>h>>w;
for (int i=1;i<=h;++i)
{
for (int j=1;j<=w;++j)
{
cin>>a[i][j];
rw[i][j]=rw[i][j-1];
if (a[i][j]=='O') rw[i][j]++;
cl[i][j]=cl[i-1][j];
if (a[i][j]=='I') cl[i][j]++;
}
}
for (int i=1;i<=h;++i)
{
for (int j=1;j<=w;++j)
{
if (a[i][j]=='J')
{
tong+=(rw[i][w]-rw[i][j])*(cl[h][j]-cl[i][j]);
}
}
}
cout<<tong;
}
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... |