| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 646905 | Olson | Bitaro the Brave (JOI19_ho_t1) | C++17 | 9 ms | 4664 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;
using ll = long long;
int main(){
int h,w;cin>>h>>w;
ll pso[h+1][w+1];
ll psi[h+1][w+1];
for(int i=0; i<=h; i++)psi[i][0]=0;
for(int i=0; i<=w; i++)pso[0][i]=0;
string s[h];
for(int i=0; i<h; i++)cin>>s[i];
for(int i=1; i<=h; i++){
for(int j=1; j<=w; j++){
psi[i][j]=psi[i-1][j];
pso[i][j]=pso[i][j-1];
if(s[i-1][j-1]=='I')psi[i][j]++;
if(s[i-1][j-1]=='O')pso[i][j]++;
}
}
int ans=0;
for(int i=1; i<=h; i++){
for(int j=1; j<=w; j++){
if(s[i-1][j-1]=='J'){
int m = psi[h][j]-psi[i][j];
int n = pso[i][w]-pso[i][j];
ans+=m*n;
}
}
}
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... | ||||
