Submission #532839

#TimeUsernameProblemLanguageResultExecution timeMemory
532839amunduzbaevBitaro the Brave (JOI19_ho_t1)C++17
100 / 100
77 ms19016 KiB
#include "bits/stdc++.h" using namespace std; #define ar array #define int long long signed main(){ ios::sync_with_stdio(0); cin.tie(0); int n, m; cin>>n>>m; vector<string> a(n); for(int i=0;i<n;i++) cin>>a[i]; vector<int> row(n), col(m); int res = 0; for(int i=n-1;~i;i--){ for(int j=m-1;~j;j--){ if(a[i][j] == 'J'){ res += row[i] * col[j]; } if(a[i][j] == 'O') row[i]++; if(a[i][j] == 'I') col[j]++; } } cout<<res<<"\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...