Submission #529336

#TimeUsernameProblemLanguageResultExecution timeMemory
529336daisyBitaro the Brave (JOI19_ho_t1)C++17
20 / 100
12 ms7876 KiB
#include<iostream> #define endl '\n' using namespace std; int red,col,bro[3005][3005],bri[3005][3005],br=0; char c[3005][3005]; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>red>>col; for(int i=0;i<red;i++) { for(int j=0;j<col;j++) { cin>>c[i][j]; } } for(int i=0;i<red;i++) { for(int j=col-1;j>=0;j--) { if(c[i][j]=='O') bro[i][j]++; bro[i][j]+=bro[i][j+1]; } } for(int i=0;i<col;i++) { for(int j=red-1;j>=0;j--) { if(c[j][i]=='I') bri[j][i]++; bri[j][i]+=bri[j+1][i]; } } for(int i=0;i<red;i++) { for(int j=0;j<col;j++) { if(c[i][j]=='J') br+=(bro[i][j+1]*bri[i+1][j]); } } cout<<br<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...