# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
127443 | 2019-07-09T11:35:13 Z | arnold518 | Bitaro the Brave (JOI19_ho_t1) | C++14 | 392 ms | 88824 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 3000; int N, M, O[MAXN+10][MAXN+10], I[MAXN+10][MAXN+10]; ll ans; char S[MAXN+10][MAXN+10]; int main() { int i, j; scanf("%d%d", &N, &M); for(i=1; i<=N; i++) scanf("%s", S[i]+1); for(j=1; j<=N; j++) for(i=M; i>=1; i--) O[j][i]=O[j][i+1]+(S[j][i]=='O'); for(j=1; j<=M; j++) for(i=N; i>=1; i--) I[i][j]=I[i+1][j]+(S[i][j]=='I'); for(i=1; i<=N; i++) for(j=1; j<=M; j++) { if(S[i][j]=='J') ans+=O[i][j]*I[i][j]; } 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 | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 504 KB | Output is correct |
5 | Correct | 3 ms | 1528 KB | Output is correct |
6 | Correct | 3 ms | 1528 KB | Output is correct |
7 | Correct | 3 ms | 1400 KB | Output is correct |
8 | Correct | 3 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 | 3 ms | 1528 KB | Output is correct |
12 | Correct | 3 ms | 1528 KB | Output is correct |
13 | Correct | 3 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 | 504 KB | Output is correct |
5 | Correct | 3 ms | 1528 KB | Output is correct |
6 | Correct | 3 ms | 1528 KB | Output is correct |
7 | Correct | 3 ms | 1400 KB | Output is correct |
8 | Correct | 3 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 | 3 ms | 1528 KB | Output is correct |
12 | Correct | 3 ms | 1528 KB | Output is correct |
13 | Correct | 3 ms | 1400 KB | Output is correct |
14 | Correct | 11 ms | 7416 KB | Output is correct |
15 | Correct | 8 ms | 4984 KB | Output is correct |
16 | Correct | 7 ms | 4216 KB | Output is correct |
17 | Correct | 2 ms | 376 KB | Output is correct |
18 | Correct | 13 ms | 7800 KB | Output is correct |
19 | Correct | 11 ms | 7672 KB | Output is correct |
20 | Correct | 11 ms | 7672 KB | Output is correct |
21 | Correct | 12 ms | 8056 KB | Output is correct |
22 | Correct | 11 ms | 7928 KB | Output is correct |
23 | Correct | 11 ms | 7928 KB | Output is correct |
24 | Correct | 13 ms | 8056 KB | Output is correct |
25 | Correct | 12 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 | 504 KB | Output is correct |
5 | Correct | 3 ms | 1528 KB | Output is correct |
6 | Correct | 3 ms | 1528 KB | Output is correct |
7 | Correct | 3 ms | 1400 KB | Output is correct |
8 | Correct | 3 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 | 3 ms | 1528 KB | Output is correct |
12 | Correct | 3 ms | 1528 KB | Output is correct |
13 | Correct | 3 ms | 1400 KB | Output is correct |
14 | Correct | 11 ms | 7416 KB | Output is correct |
15 | Correct | 8 ms | 4984 KB | Output is correct |
16 | Correct | 7 ms | 4216 KB | Output is correct |
17 | Correct | 2 ms | 376 KB | Output is correct |
18 | Correct | 13 ms | 7800 KB | Output is correct |
19 | Correct | 11 ms | 7672 KB | Output is correct |
20 | Correct | 11 ms | 7672 KB | Output is correct |
21 | Correct | 12 ms | 8056 KB | Output is correct |
22 | Correct | 11 ms | 7928 KB | Output is correct |
23 | Correct | 11 ms | 7928 KB | Output is correct |
24 | Correct | 13 ms | 8056 KB | Output is correct |
25 | Correct | 12 ms | 7928 KB | Output is correct |
26 | Correct | 11 ms | 7800 KB | Output is correct |
27 | Correct | 369 ms | 88116 KB | Output is correct |
28 | Correct | 26 ms | 25980 KB | Output is correct |
29 | Correct | 14 ms | 7800 KB | Output is correct |
30 | Correct | 3 ms | 632 KB | Output is correct |
31 | Correct | 270 ms | 72696 KB | Output is correct |
32 | Correct | 349 ms | 88724 KB | Output is correct |
33 | Correct | 348 ms | 88284 KB | Output is correct |
34 | Correct | 323 ms | 84348 KB | Output is correct |
35 | Correct | 358 ms | 88568 KB | Output is correct |
36 | Correct | 353 ms | 88440 KB | Output is correct |
37 | Correct | 392 ms | 88824 KB | Output is correct |
38 | Correct | 249 ms | 72736 KB | Output is correct |
39 | Correct | 250 ms | 72604 KB | Output is correct |