제출 #1158296

#제출 시각아이디문제언어결과실행 시간메모리
1158296soduynga45Bitaro the Brave (JOI19_ho_t1)C++20
50 / 100
1092 ms21836 KiB
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    float db,y[100000],x[1000000];
    long long t,i,l,n,mod=1000000007,c,a,m,e,d,b,k,j,w[300005],f,z[500005],g=0,q,p,r[500005],h,o[1001][1001];
    map<ll,ll>blp;
    set<ll>st;
    string s,sa[200005],ta[200005],sn,sm,sk,cr,sx,sy;
    pair<ll,ll>pr[500005];
    char ch[200005];
    vector<ll>ret,v;
    cin>>n>>m;
    for (i=0; i<n; i++){
        cin>>sa[i];
    }
    a=0;
    for (i=0; i<n; i++){
        for (j=0; j<m; j++){
            if (sa[i][j]=='J'){
                e=0;
                d=0;
                for (k=i; k<n; k++){
                    if (sa[k][j]=='I'){
                        d++;    
                    }
                }
                for (l=j; l<m; l++){
                    if (sa[i][l]=='O'){
                        e++;
                    }
                }
                a=a+e*d;
            }
        }
    }
    cout<<a;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...