답안 #922101

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
922101 2024-02-05T04:37:48 Z 406 Bitaro the Brave (JOI19_ho_t1) C++17
100 / 100
115 ms 163040 KB
#include <bits/stdc++.h>
#define int int64_t
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)

using namespace std;
using ar = array<int, 2>;

const int64_t INF = 1ll << 60;
const int N = 3000 + 50;
string s[N];
int n, m, cntI[N][N], cntO[N][N];

signed main() {
        ios::sync_with_stdio(false);
        cin.tie(nullptr); 
        cin >> n >> m;
        FOR(i, 0, n) cin >> s[i];
        int ans = 0;
        for (int i = n - 1; i >= 0; --i) {
                for (int j = m - 1; j >= 0; --j) {
                        cntI[i][j] = cntI[i][j + 1] + (s[i][j] == 'O');
                        cntO[i][j] = cntO[i + 1][j] + (s[i][j] == 'I');
                        ans += (s[i][j] == 'J' ? cntI[i][j] * cntO[i][j] : 0);
                }
        }
        cout << ans << '\n';
        return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 604 KB Output is correct
5 Correct 1 ms 3164 KB Output is correct
6 Correct 1 ms 2908 KB Output is correct
7 Correct 1 ms 1372 KB Output is correct
8 Correct 1 ms 3164 KB Output is correct
9 Correct 1 ms 3128 KB Output is correct
10 Correct 1 ms 1372 KB Output is correct
11 Correct 1 ms 3160 KB Output is correct
12 Correct 1 ms 2908 KB Output is correct
13 Correct 1 ms 1372 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 604 KB Output is correct
5 Correct 1 ms 3164 KB Output is correct
6 Correct 1 ms 2908 KB Output is correct
7 Correct 1 ms 1372 KB Output is correct
8 Correct 1 ms 3164 KB Output is correct
9 Correct 1 ms 3128 KB Output is correct
10 Correct 1 ms 1372 KB Output is correct
11 Correct 1 ms 3160 KB Output is correct
12 Correct 1 ms 2908 KB Output is correct
13 Correct 1 ms 1372 KB Output is correct
14 Correct 5 ms 15020 KB Output is correct
15 Correct 2 ms 10588 KB Output is correct
16 Correct 2 ms 7516 KB Output is correct
17 Correct 0 ms 564 KB Output is correct
18 Correct 5 ms 15708 KB Output is correct
19 Correct 5 ms 15704 KB Output is correct
20 Correct 5 ms 15452 KB Output is correct
21 Correct 5 ms 15708 KB Output is correct
22 Correct 4 ms 15708 KB Output is correct
23 Correct 4 ms 15452 KB Output is correct
24 Correct 5 ms 15672 KB Output is correct
25 Correct 4 ms 15708 KB Output is correct
26 Correct 4 ms 15536 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 604 KB Output is correct
5 Correct 1 ms 3164 KB Output is correct
6 Correct 1 ms 2908 KB Output is correct
7 Correct 1 ms 1372 KB Output is correct
8 Correct 1 ms 3164 KB Output is correct
9 Correct 1 ms 3128 KB Output is correct
10 Correct 1 ms 1372 KB Output is correct
11 Correct 1 ms 3160 KB Output is correct
12 Correct 1 ms 2908 KB Output is correct
13 Correct 1 ms 1372 KB Output is correct
14 Correct 5 ms 15020 KB Output is correct
15 Correct 2 ms 10588 KB Output is correct
16 Correct 2 ms 7516 KB Output is correct
17 Correct 0 ms 564 KB Output is correct
18 Correct 5 ms 15708 KB Output is correct
19 Correct 5 ms 15704 KB Output is correct
20 Correct 5 ms 15452 KB Output is correct
21 Correct 5 ms 15708 KB Output is correct
22 Correct 4 ms 15708 KB Output is correct
23 Correct 4 ms 15452 KB Output is correct
24 Correct 5 ms 15672 KB Output is correct
25 Correct 4 ms 15708 KB Output is correct
26 Correct 4 ms 15536 KB Output is correct
27 Correct 115 ms 161856 KB Output is correct
28 Correct 11 ms 63836 KB Output is correct
29 Correct 6 ms 14940 KB Output is correct
30 Correct 1 ms 860 KB Output is correct
31 Correct 56 ms 133168 KB Output is correct
32 Correct 61 ms 162816 KB Output is correct
33 Correct 59 ms 162568 KB Output is correct
34 Correct 64 ms 154452 KB Output is correct
35 Correct 63 ms 162788 KB Output is correct
36 Correct 68 ms 162460 KB Output is correct
37 Correct 83 ms 163040 KB Output is correct
38 Correct 46 ms 132996 KB Output is correct
39 Correct 45 ms 132688 KB Output is correct