제출 #1123228

#제출 시각아이디문제언어결과실행 시간메모리
1123228LucaIlieBitaro the Brave (JOI19_ho_t1)C++20
100 / 100
379 ms9136 KiB
#include <bits/stdc++.h> using namespace std; const int MAX_N = 3000; char mat[MAX_N][MAX_N]; int frecvCol[MAX_N]; int main() { int n, m; cin >> n >> m; for ( int l = 0; l < n; l++ ) { for ( int c = 0; c < m; c++ ) cin >> mat[l][c]; } long long ans = 0; for ( int l = n - 1; l >= 0; l-- ) { int frecvLin = 0; for ( int c = m - 1; c >= 0; c-- ) { if ( mat[l][c] == 'J' ) ans += frecvLin * frecvCol[c]; else if ( mat[l][c] == 'O' ) frecvLin++; else frecvCol[c]++; } } cout << ans << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...