Submission #995522

#TimeUsernameProblemLanguageResultExecution timeMemory
995522Luca1234Bitaro the Brave (JOI19_ho_t1)C++14
100 / 100
321 ms88404 KiB
#include <iostream> using namespace std; char mat[3003][3003]; int spo[3003][3003], spi[3003][3003]; int main() { int n, m; cin>>n>>m; for(int i=1; i<=n; i++) { for(int j=1; j<=m; j++) { cin>>mat[i][j]; spo[i][j]=spo[i][j-1]+(mat[i][j]=='O'); spi[i][j]=spi[i-1][j]+(mat[i][j]=='I'); } } long long cnt=0; for(int i=1; i<=n; i++) { for(int j=1; j<=m; j++) { if(mat[i][j]=='J') { cnt+=(spo[i][m]-spo[i][j])*(spi[n][j]-spi[i][j]); } } } cout<<cnt; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...