# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
160526 | 2019-10-28T09:34:21 Z | dantoh000 | Bitaro the Brave (JOI19_ho_t1) | C++14 | 552 ms | 9720 KB |
#include <bits/stdc++.h> #define int long long using namespace std; main(){ int n,m; scanf("%lld%lld",&n,&m); char grid[n][m]; for (int i = 0; i < n; i++){ for (int j = 0; j < m; j++){ scanf(" %c",&grid[i][j]); } } int ans = 0; int ct[m]; memset(ct,0,sizeof(ct)); for (int i = n-1; i >= 0; i--){ int ct2 = 0; for (int j = m-1; j >= 0; j--){ if (grid[i][j] == 'O') ct2++; else if (grid[i][j] == 'I') ct[j]++; else ans += ct[j]*ct2; } } printf("%lld ",ans); }
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 | 7 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 3 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 256 KB | Output is correct |
7 | Correct | 2 ms | 376 KB | Output is correct |
8 | Correct | 3 ms | 376 KB | Output is correct |
9 | Correct | 2 ms | 376 KB | Output is correct |
10 | Correct | 2 ms | 376 KB | Output is correct |
11 | Correct | 3 ms | 380 KB | Output is correct |
12 | Correct | 2 ms | 376 KB | Output is correct |
13 | Correct | 2 ms | 376 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 | 7 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 3 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 256 KB | Output is correct |
7 | Correct | 2 ms | 376 KB | Output is correct |
8 | Correct | 3 ms | 376 KB | Output is correct |
9 | Correct | 2 ms | 376 KB | Output is correct |
10 | Correct | 2 ms | 376 KB | Output is correct |
11 | Correct | 3 ms | 380 KB | Output is correct |
12 | Correct | 2 ms | 376 KB | Output is correct |
13 | Correct | 2 ms | 376 KB | Output is correct |
14 | Correct | 14 ms | 632 KB | Output is correct |
15 | Correct | 2 ms | 252 KB | Output is correct |
16 | Correct | 9 ms | 632 KB | Output is correct |
17 | Correct | 2 ms | 376 KB | Output is correct |
18 | Correct | 17 ms | 888 KB | Output is correct |
19 | Correct | 16 ms | 760 KB | Output is correct |
20 | Correct | 16 ms | 760 KB | Output is correct |
21 | Correct | 18 ms | 760 KB | Output is correct |
22 | Correct | 15 ms | 760 KB | Output is correct |
23 | Correct | 17 ms | 760 KB | Output is correct |
24 | Correct | 17 ms | 760 KB | Output is correct |
25 | Correct | 15 ms | 760 KB | Output is correct |
26 | Correct | 15 ms | 760 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 | 7 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 3 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 256 KB | Output is correct |
7 | Correct | 2 ms | 376 KB | Output is correct |
8 | Correct | 3 ms | 376 KB | Output is correct |
9 | Correct | 2 ms | 376 KB | Output is correct |
10 | Correct | 2 ms | 376 KB | Output is correct |
11 | Correct | 3 ms | 380 KB | Output is correct |
12 | Correct | 2 ms | 376 KB | Output is correct |
13 | Correct | 2 ms | 376 KB | Output is correct |
14 | Correct | 14 ms | 632 KB | Output is correct |
15 | Correct | 2 ms | 252 KB | Output is correct |
16 | Correct | 9 ms | 632 KB | Output is correct |
17 | Correct | 2 ms | 376 KB | Output is correct |
18 | Correct | 17 ms | 888 KB | Output is correct |
19 | Correct | 16 ms | 760 KB | Output is correct |
20 | Correct | 16 ms | 760 KB | Output is correct |
21 | Correct | 18 ms | 760 KB | Output is correct |
22 | Correct | 15 ms | 760 KB | Output is correct |
23 | Correct | 17 ms | 760 KB | Output is correct |
24 | Correct | 17 ms | 760 KB | Output is correct |
25 | Correct | 15 ms | 760 KB | Output is correct |
26 | Correct | 15 ms | 760 KB | Output is correct |
27 | Correct | 532 ms | 9720 KB | Output is correct |
28 | Correct | 3 ms | 376 KB | Output is correct |
29 | Correct | 40 ms | 1528 KB | Output is correct |
30 | Correct | 4 ms | 376 KB | Output is correct |
31 | Correct | 410 ms | 7408 KB | Output is correct |
32 | Correct | 521 ms | 9696 KB | Output is correct |
33 | Correct | 495 ms | 9608 KB | Output is correct |
34 | Correct | 456 ms | 8056 KB | Output is correct |
35 | Correct | 510 ms | 9420 KB | Output is correct |
36 | Correct | 495 ms | 9456 KB | Output is correct |
37 | Correct | 552 ms | 9364 KB | Output is correct |
38 | Correct | 345 ms | 6648 KB | Output is correct |
39 | Correct | 350 ms | 6480 KB | Output is correct |