제출 #889053

#제출 시각아이디문제언어결과실행 시간메모리
889053BBart888Bitaro the Brave (JOI19_ho_t1)C++14
0 / 100
0 ms356 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN= 3e3 + 11; using ll = long long; int H,W; string S[MAXN]; ll cntI[MAXN]; ll cntO[MAXN]; ll ans; int main() { cin.tie(0); cout.tie(0); cin >> H >> W; for(int i = 0;i<H;i++) { cin>>S[i]; } for(int i =0;i<H;i++) { for(int j = 0;j<W;j++) { cntO[i]+=(S[i][j] == 'O'); cntI[j]+=(S[i][j] == 'I'); } } for(int i = 0;i<H;i++) { for(int j = 0;j<W;j++) { if(S[i][j] == 'J') { ans+=(cntO[i]*cntI[j]); } } } cout<<ans<<'\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...