Submission #1093666

# Submission time Handle Problem Language Result Execution time Memory
1093666 2024-09-27T08:06:50 Z v1vy Bitaro the Brave (JOI19_ho_t1) C++17
0 / 100
1 ms 348 KB
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N=3007;
int h,w,ai[N][N],ao[N][N],cnt;
char a[N][N];
int32_t main(){
    cin.tie(NULL)->sync_with_stdio(false);
    cin>>h>>w;
    for (int i=1; i<=h; i++){
        string s;
        cin>>s;
        for (int j=1; j<=w; j++){
            a[i][j]=s[j-1];
        }
    }/*
    for (int i=1; i<=h; i++){
        for (int j=1; j<=w; j++){
            cout<<a[i][j];
        }
        cout<<'\n';
    }*/
    for (int i=h; i>0; i--){
        for (int j=w; j>0; j--){
            if (a[i][j]=='I') ai[i][j]=ai[i+1][j]+1;
            else ai[i][j]=ai[i+1][j];
            if (a[i][j]=='O') ao[i][j]=ao[i][j+1]+1;
            else ao[i][j]=ao[i][j+1];
        }
    }
    for (int i=1; i<=h; i++){
        for (int j=1; j<=w; j++){
            if(a[i][j]=='J') cnt+=ai[i][j]*ao[i][j];
        }
    }
    cout<<cnt;

    cout<<"\n";
    for (int i=1; i<=h; i++){
        for (int j=1; j<=w; j++){
            cout<<ai[i][j]<<' ';
        }
        cout<<'\n';
    }

    for (int i=1; i<=h; i++){
        for (int j=1; j<=w; j++){
            cout<<ao[i][j]<<' ';
        }
        cout<<'\n';
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -