| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1355473 | andriabandria | Bitaro the Brave (JOI19_ho_t1) | C++20 | 242 ms | 82268 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin>>h>>w;
string s[h];
for(int i=0; i<h; i++)
cin>>s[i];
int r[h][w], c[h][w];
for (int i=0; i<h; i++){
int x=0;
for(int j=w-1; j>=0; j--){
r[i][j]=x;
if (s[i][j]=='O') x++;}}
for (int j=0; j<w; j++){
int x = 0;
for (int i=h-1; i>=0; i--){
c[i][j]=x;
if (s[i][j]=='I') x++;}}
long long a=0;
for (int i=0; i<h; i++) {
for (int j=0; j<w; j++) {
if (s[i][j]=='J') {
a+=1LL*r[i][j]*c[i][j];}}}
cout<<a;
return 0;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
