# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
160484 | 2019-10-27T17:27:18 Z | kingfran1907 | Bitaro the Brave (JOI19_ho_t1) | C++14 | 168 ms | 53372 KB |
#include <bits/stdc++.h> using namespace std; typedef long long llint; const int maxn = 3010; int n, m; char niz[maxn][maxn]; int pref[maxn][maxn]; llint cnt[maxn]; int main() { scanf("%d%d", &n, &m); for (int i = 0; i < n; i++) scanf("%s", niz+i); llint sol = 0; for (int i = 0; i < n; i++) { for (int j = m - 1; j >= 0; j--) pref[i][j] = pref[i][j + 1] + (niz[i][j] == 'O'); } for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { if (niz[i][j] == 'J') cnt[j] += pref[i][j]; else if (niz[i][j] == 'I') { sol += cnt[j]; //printf("%d %d -> %d\n", i, j, cnt[j]); } } } printf("%lld\n", sol); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 3 ms | 1144 KB | Output is correct |
6 | Correct | 3 ms | 1016 KB | Output is correct |
7 | Correct | 2 ms | 1016 KB | Output is correct |
8 | Correct | 3 ms | 1144 KB | Output is correct |
9 | Correct | 3 ms | 1020 KB | Output is correct |
10 | Correct | 3 ms | 1016 KB | Output is correct |
11 | Correct | 3 ms | 1148 KB | Output is correct |
12 | Correct | 4 ms | 1016 KB | Output is correct |
13 | Correct | 3 ms | 1016 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 3 ms | 1144 KB | Output is correct |
6 | Correct | 3 ms | 1016 KB | Output is correct |
7 | Correct | 2 ms | 1016 KB | Output is correct |
8 | Correct | 3 ms | 1144 KB | Output is correct |
9 | Correct | 3 ms | 1020 KB | Output is correct |
10 | Correct | 3 ms | 1016 KB | Output is correct |
11 | Correct | 3 ms | 1148 KB | Output is correct |
12 | Correct | 4 ms | 1016 KB | Output is correct |
13 | Correct | 3 ms | 1016 KB | Output is correct |
14 | Correct | 9 ms | 4728 KB | Output is correct |
15 | Correct | 5 ms | 3324 KB | Output is correct |
16 | Correct | 5 ms | 2808 KB | Output is correct |
17 | Correct | 2 ms | 376 KB | Output is correct |
18 | Correct | 10 ms | 4984 KB | Output is correct |
19 | Correct | 8 ms | 4932 KB | Output is correct |
20 | Correct | 8 ms | 4984 KB | Output is correct |
21 | Correct | 10 ms | 5112 KB | Output is correct |
22 | Correct | 8 ms | 4984 KB | Output is correct |
23 | Correct | 8 ms | 4856 KB | Output is correct |
24 | Correct | 10 ms | 5116 KB | Output is correct |
25 | Correct | 9 ms | 4984 KB | Output is correct |
26 | Correct | 14 ms | 4856 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 3 ms | 1144 KB | Output is correct |
6 | Correct | 3 ms | 1016 KB | Output is correct |
7 | Correct | 2 ms | 1016 KB | Output is correct |
8 | Correct | 3 ms | 1144 KB | Output is correct |
9 | Correct | 3 ms | 1020 KB | Output is correct |
10 | Correct | 3 ms | 1016 KB | Output is correct |
11 | Correct | 3 ms | 1148 KB | Output is correct |
12 | Correct | 4 ms | 1016 KB | Output is correct |
13 | Correct | 3 ms | 1016 KB | Output is correct |
14 | Correct | 9 ms | 4728 KB | Output is correct |
15 | Correct | 5 ms | 3324 KB | Output is correct |
16 | Correct | 5 ms | 2808 KB | Output is correct |
17 | Correct | 2 ms | 376 KB | Output is correct |
18 | Correct | 10 ms | 4984 KB | Output is correct |
19 | Correct | 8 ms | 4932 KB | Output is correct |
20 | Correct | 8 ms | 4984 KB | Output is correct |
21 | Correct | 10 ms | 5112 KB | Output is correct |
22 | Correct | 8 ms | 4984 KB | Output is correct |
23 | Correct | 8 ms | 4856 KB | Output is correct |
24 | Correct | 10 ms | 5116 KB | Output is correct |
25 | Correct | 9 ms | 4984 KB | Output is correct |
26 | Correct | 14 ms | 4856 KB | Output is correct |
27 | Correct | 157 ms | 52880 KB | Output is correct |
28 | Correct | 18 ms | 16632 KB | Output is correct |
29 | Correct | 22 ms | 4856 KB | Output is correct |
30 | Correct | 3 ms | 504 KB | Output is correct |
31 | Correct | 125 ms | 43400 KB | Output is correct |
32 | Correct | 110 ms | 53304 KB | Output is correct |
33 | Correct | 103 ms | 53212 KB | Output is correct |
34 | Correct | 149 ms | 50268 KB | Output is correct |
35 | Correct | 109 ms | 53240 KB | Output is correct |
36 | Correct | 105 ms | 53228 KB | Output is correct |
37 | Correct | 168 ms | 53372 KB | Output is correct |
38 | Correct | 81 ms | 43256 KB | Output is correct |
39 | Correct | 79 ms | 43184 KB | Output is correct |