# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
154200 | 2019-09-18T22:01:49 Z | ivandasfs | Bitaro the Brave (JOI19_ho_t1) | C++14 | 173 ms | 88460 KB |
#include <iostream> #include <cstdio> using namespace std; char a[3005][3005]; int red[3005][3005]; int stu[3005][3005]; int main() { int n,m; scanf("%d%d", &n, &m); for (int i=0 ; i<n ; i++) { scanf("%s", a[i]); } long long sol = 0; for (int i=n-1 ; i>=0 ; i--) { for (int j=m-1 ; j>=0 ; j--) { red[i][j] = red[i][j+1] + (a[i][j] == 'O'); stu[i][j] = stu[i+1][j] + (a[i][j] == 'I'); if (a[i][j] == 'J') sol += red[i][j] * stu[i][j]; } } printf("%lld\n", sol); return 0; }
Compilation message
# | Verdict | Execution time | Memory | 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 | 4 ms | 1528 KB | Output is correct |
6 | Correct | 4 ms | 1528 KB | Output is correct |
7 | Correct | 3 ms | 1400 KB | Output is correct |
8 | Correct | 4 ms | 1528 KB | Output is correct |
9 | Correct | 3 ms | 1528 KB | Output is correct |
10 | Correct | 3 ms | 1400 KB | Output is correct |
11 | Correct | 4 ms | 1532 KB | Output is correct |
12 | Correct | 4 ms | 1528 KB | Output is correct |
13 | Correct | 4 ms | 1400 KB | Output is correct |
# | Verdict | Execution time | Memory | 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 | 4 ms | 1528 KB | Output is correct |
6 | Correct | 4 ms | 1528 KB | Output is correct |
7 | Correct | 3 ms | 1400 KB | Output is correct |
8 | Correct | 4 ms | 1528 KB | Output is correct |
9 | Correct | 3 ms | 1528 KB | Output is correct |
10 | Correct | 3 ms | 1400 KB | Output is correct |
11 | Correct | 4 ms | 1532 KB | Output is correct |
12 | Correct | 4 ms | 1528 KB | Output is correct |
13 | Correct | 4 ms | 1400 KB | Output is correct |
14 | Correct | 10 ms | 7544 KB | Output is correct |
15 | Correct | 7 ms | 5112 KB | Output is correct |
16 | Correct | 7 ms | 4348 KB | Output is correct |
17 | Correct | 3 ms | 504 KB | Output is correct |
18 | Correct | 20 ms | 7944 KB | Output is correct |
19 | Correct | 10 ms | 7928 KB | Output is correct |
20 | Correct | 12 ms | 7848 KB | Output is correct |
21 | Correct | 11 ms | 7928 KB | Output is correct |
22 | Correct | 10 ms | 7932 KB | Output is correct |
23 | Correct | 10 ms | 7800 KB | Output is correct |
24 | Correct | 11 ms | 7932 KB | Output is correct |
25 | Correct | 13 ms | 7928 KB | Output is correct |
26 | Correct | 11 ms | 7800 KB | Output is correct |
# | Verdict | Execution time | Memory | 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 | 4 ms | 1528 KB | Output is correct |
6 | Correct | 4 ms | 1528 KB | Output is correct |
7 | Correct | 3 ms | 1400 KB | Output is correct |
8 | Correct | 4 ms | 1528 KB | Output is correct |
9 | Correct | 3 ms | 1528 KB | Output is correct |
10 | Correct | 3 ms | 1400 KB | Output is correct |
11 | Correct | 4 ms | 1532 KB | Output is correct |
12 | Correct | 4 ms | 1528 KB | Output is correct |
13 | Correct | 4 ms | 1400 KB | Output is correct |
14 | Correct | 10 ms | 7544 KB | Output is correct |
15 | Correct | 7 ms | 5112 KB | Output is correct |
16 | Correct | 7 ms | 4348 KB | Output is correct |
17 | Correct | 3 ms | 504 KB | Output is correct |
18 | Correct | 20 ms | 7944 KB | Output is correct |
19 | Correct | 10 ms | 7928 KB | Output is correct |
20 | Correct | 12 ms | 7848 KB | Output is correct |
21 | Correct | 11 ms | 7928 KB | Output is correct |
22 | Correct | 10 ms | 7932 KB | Output is correct |
23 | Correct | 10 ms | 7800 KB | Output is correct |
24 | Correct | 11 ms | 7932 KB | Output is correct |
25 | Correct | 13 ms | 7928 KB | Output is correct |
26 | Correct | 11 ms | 7800 KB | Output is correct |
27 | Correct | 136 ms | 88028 KB | Output is correct |
28 | Correct | 28 ms | 25988 KB | Output is correct |
29 | Correct | 12 ms | 7800 KB | Output is correct |
30 | Correct | 3 ms | 632 KB | Output is correct |
31 | Correct | 108 ms | 72608 KB | Output is correct |
32 | Correct | 123 ms | 88388 KB | Output is correct |
33 | Correct | 130 ms | 88156 KB | Output is correct |
34 | Correct | 139 ms | 84216 KB | Output is correct |
35 | Correct | 118 ms | 88460 KB | Output is correct |
36 | Correct | 120 ms | 88244 KB | Output is correct |
37 | Correct | 173 ms | 88440 KB | Output is correct |
38 | Correct | 91 ms | 72588 KB | Output is correct |
39 | Correct | 91 ms | 72312 KB | Output is correct |