| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1123228 | LucaIlie | Bitaro the Brave (JOI19_ho_t1) | C++20 | 379 ms | 9136 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 time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
