Submission #886275

#TimeUsernameProblemLanguageResultExecution timeMemory
886275stefanneaguBitaro the Brave (JOI19_ho_t1)C++17
50 / 100
90 ms5212 KiB
#include <bits/stdc++.h> using namespace std; const int nmax = 1e3 + 1; char mat[nmax][nmax]; int O[nmax], I[nmax]; 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]; } } long long ans = 0; for(int i = n; i>=1; i--) { for(int j=m; j>=1; j--) { if(mat[i][j] == 'J') { ans += (long long) I[j] * O[i]; // cout << i << " " << j << ": " << O[i] << " " << I[j] << endl; } if(mat[i][j] == 'O') { O[i] ++; } if(mat[i][j] == 'I') { I[j] ++; } } } cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...