Submission #1003043

#TimeUsernameProblemLanguageResultExecution timeMemory
1003043tamir1Bitaro the Brave (JOI19_ho_t1)C++17
50 / 100
1051 ms17444 KiB
#include<bits/stdc++.h> #define ll long long using namespace std; ll ans,x,y,n,m,i,j,k,l; char s[3001][3001]; int main(){ cin >> n >> m; for(i=1;i<=n;i++){ for(j=1;j<=m;j++){ cin >> s[i][j]; } } for(i=1;i<=n;i++){ for(j=1;j<=m;j++){ if(s[i][j]=='J'){ x=0; y=0; for(l=j+1;l<=m;l++) if(s[i][l]=='O') x++; for(k=i+1;k<=n;k++) if(s[k][j]=='I') y++; ans+=x*y; } } } cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...