제출 #172049

#제출 시각아이디문제언어결과실행 시간메모리
172049mdn2002Bitaro the Brave (JOI19_ho_t1)C++14
20 / 100
17 ms8056 KiB
#include<bits/stdc++.h> using namespace std; const long long mod=1e9+7; int n,m,ans,orb[3050][3050],ing[3050][3050]; char c[3050][3050]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin>>n>>m; for(int i=0;i<n;i++) { for(int j=0;j<m;j++) { cin>>c[i][j]; if(c[i][j]=='I')ing[i][j]++; else if(c[i][j]=='O') orb[i][j]++; } } for(int i=0;i<n;i++) { for(int j=m-1;j>=0;j--)orb[i][j]+=orb[i][j+1]; } for(int i=0;i<m;i++) { for(int j=n-1;j>=0;j--)ing[j][i]+=ing[j+1][i]; } for(int i=0;i<n;i++) { for(int j=0;j<m;j++) { if(c[i][j]=='J')ans+=ing[i][j]*orb[i][j]; } } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...