| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 334415 | Tahmid690 | Bitaro the Brave (JOI19_ho_t1) | C++14 | 449 ms | 87276 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
int h,w;
string s[3005];
int rows[3005];
int colum[3005];
int rowsfin[3005][3005];
int columfin[3005][3005];
int main(){
cin >> h >> w;
for(int i=0;i<h;i++) cin >> s[i];
for(int i=0;i<h;i++){
int x=0;
for(int j=0;j<w;j++){
if(s[i][j]=='O') x++;
rowsfin[i][j+1]=x;
}
rows[i]=x;
}
for(int i=0;i<w;i++){
int x=0;
for(int j=0;j<h;j++){
if(s[j][i]=='I') x++;
columfin[i][j+1]=x;
}
colum[i]=x;
}
ll ans=0;
for(ll i=0;i<h;i++){
for(ll j=0;j<w;j++){
ll a,b,c,d;
a=rows[i];
b=rowsfin[i][j];
c=colum[j];
d=columfin[j][i];
if(s[i][j]=='J') ans+=((a-b)*(c-d));
}
}
cout << ans << endl;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
