Submission #97755

#TimeUsernameProblemLanguageResultExecution timeMemory
97755Bodo171Bitaro the Brave (JOI19_ho_t1)C++14
100 / 100
99 ms9404 KiB
#include <iostream> #include <fstream> using namespace std; int lin[3005],col[3005]; string s[3005]; int n,m,i,j; long long ans; int main() { //freopen("data.in","r",stdin); ios_base::sync_with_stdio(false); cin>>n>>m; for(i=1;i<=n;i++) { cin>>s[i]; s[i]=' '+s[i]; } for(i=n;i>=1;i--) for(j=m;j>=1;j--) { if(s[i][j]=='O') lin[i]++; if(s[i][j]=='I') col[j]++; if(s[i][j]=='J') ans+=1LL*lin[i]*col[j]; } cout<<ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...