Submission #680439

#TimeUsernameProblemLanguageResultExecution timeMemory
680439tigarBitaro the Brave (JOI19_ho_t1)C++14
20 / 100
12 ms7000 KiB
#include <bits/stdc++.h> using namespace std; int os[3003][3003], is[3003][3003]; int main() { int H, W; cin>>H>>W; string rows[3003]; for(int i=0; i<H; i++)cin>>rows[i]; for(int i=0; i<H; i++) { int cnt=0; for(int j=W-1; j>=0; j--) { os[i][j]=cnt; if(rows[i][j]=='O')cnt++; } } for(int i=0; i<W; i++) { int cnt=0; for(int j=H-1; j>=0; j--) { is[j][i]=cnt; if(rows[j][i]=='I')cnt++; } } int rezz=0; for(int i=0; i<H; i++) { for(int j=0; j<W; j++) { if(rows[i][j]=='J')rezz+=os[i][j]*is[i][j]; //cout<<os[i][j]<<" "; } //cout<<endl; } cout<<rezz; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...