| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1355094 | lizi14 | Bitaro the Brave (JOI19_ho_t1) | C++20 | 317 ms | 150104 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define f first
#define ss second
#define ina insert
#define pb push_back
signed main(){
int n,m;
cin>>n>>m;
char x[n][m];
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
cin>>x[i][j];
}
}
int a[n][m];
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
a[i][j]=0;
}
}
int b[n][m];
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
b[i][j]=0;
}
}
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
if(x[i][j]=='O'){
a[i][j]=1;
}
if(j>0){
a[i][j]+=a[i][j-1];
}
if(x[i][j]=='I'){
b[i][j]=1;
}
if(i>0){
b[i][j]+=b[i-1][j];
}
}
}
int sum=0;
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
if(x[i][j]=='J'){
int k=a[i][m-1]-a[i][j];
int g=b[n-1][j]-b[i][j];
sum+=k*g;
}
}
}
cout<<sum<<endl;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
