Submission #717565

#TimeUsernameProblemLanguageResultExecution timeMemory
717565vjudge1Bitaro the Brave (JOI19_ho_t1)C++14
20 / 100
54 ms2936 KiB
#include<bits/stdc++.h> using namespace std; char ma[3001][3001]; vector <pair<int,int>> di; int main(){ int n,m,i,j,ans=0; cin>>n>>m; string s; for( i=0;i<n;i++){ cin>>s; for( j=0;j<m;j++) ma[i][j]=s[j]; } for(i=0;i<n;i++){ for(int j=0;j<m;j++){ if(ma[i][j]=='J') di.push_back({i,j}); } } for(pair<int,int> x:di){ int tw=x.first; int on=x.second; int s1=0,s2=0; for(i=on+1;i<m;i++){ if(ma[tw][i]=='O') s1++; } for(i=tw+1;i<n;i++){ if(ma[i][on]=='I') s2++; } ans+=s1*s2; } cout<<ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...