Submission #1133305

#TimeUsernameProblemLanguageResultExecution timeMemory
1133305MunkhturErdenebatBitaro the Brave (JOI19_ho_t1)C++20
50 / 100
552 ms339968 KiB
#include<bits/stdc++.h> #include<string.h> #include <algorithm> #include <stdlib.h> #define ll long long using namespace std; ll a,b,c,d,e,f,m,i,j,n,h,g,l,r,ka,p,q; map<ll,ll> maa,mii,mee; vector<ll> vj,vo,vi; string x[3001],y,z; map<ll,ll> k[3005],t[3005]; int main(){ cin>>a>>b; for(i=1 ; i<=a ; i++){ cin>>x[i]; } for(i=1 ; i<=a ; i++){ for(j=0 ; j<b ; j++){ if(x[i][j]=='O'){ k[i][j]=k[i][j-1]+1; } else{ k[i][j]=k[i][j-1]; } } } for(i=0 ; i<b ; i++){ for(j=1 ; j<=a ; j++){ if(x[j][i]=='I'){ t[j][i]=t[j-1][i]+1; } else{ t[j][i]=t[j-1][i]; } } } h=0; for(i=1 ; i<=a ; i++){ for(j=0 ; j<b ; j++){ if(x[i][j]=='J'){ h+=(k[i][b-1]-k[i][j])*(t[a][j]-t[i][j]); } } } cout<<h<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...