# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
157928 | 2019-10-13T20:03:50 Z | GioChkhaidze | Bitaro the Brave (JOI19_ho_t1) | C++14 | 520 ms | 88632 KB |
#include <bits/stdc++.h> using namespace std; const int N=3005; int n,m,Orb[N][N],Ingot[N][N]; long long ANS; char c[N][N]; main () { ios::sync_with_stdio(false); cin>>n>>m; for (int i=1; i<=n; i++) { for (int j=1; j<=m; j++) cin>>c[i][j]; } for (int i=1; i<=n; i++) { int cnt=0; for (int j=m; j>=1; j--) { Orb[i][j]=cnt; cnt+=(c[i][j]=='O'); } } for (int j=1; j<=m; j++) { int cnt=0; for (int i=n; i>=1; i--) { Ingot[i][j]=cnt; cnt+=(c[i][j]=='I'); } } for (int i=1; i<=n; i++) { for (int j=1; j<=m; j++) if (c[i][j]=='J') ANS+=Ingot[i][j]*Orb[i][j]; } cout<<ANS<<endl; }
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 | 4 ms | 1548 KB | Output is correct |
12 | Correct | 3 ms | 1528 KB | Output is correct |
13 | Correct | 8 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 | 4 ms | 1548 KB | Output is correct |
12 | Correct | 3 ms | 1528 KB | Output is correct |
13 | Correct | 8 ms | 1400 KB | Output is correct |
14 | Correct | 14 ms | 7544 KB | Output is correct |
15 | Correct | 6 ms | 5112 KB | Output is correct |
16 | Correct | 9 ms | 4388 KB | Output is correct |
17 | Correct | 2 ms | 504 KB | Output is correct |
18 | Correct | 15 ms | 8056 KB | Output is correct |
19 | Correct | 14 ms | 7928 KB | Output is correct |
20 | Correct | 14 ms | 7868 KB | Output is correct |
21 | Correct | 15 ms | 8056 KB | Output is correct |
22 | Correct | 14 ms | 7928 KB | Output is correct |
23 | Correct | 14 ms | 7928 KB | Output is correct |
24 | Correct | 16 ms | 8056 KB | Output is correct |
25 | Correct | 14 ms | 7928 KB | Output is correct |
26 | Correct | 14 ms | 7928 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 | 4 ms | 1548 KB | Output is correct |
12 | Correct | 3 ms | 1528 KB | Output is correct |
13 | Correct | 8 ms | 1400 KB | Output is correct |
14 | Correct | 14 ms | 7544 KB | Output is correct |
15 | Correct | 6 ms | 5112 KB | Output is correct |
16 | Correct | 9 ms | 4388 KB | Output is correct |
17 | Correct | 2 ms | 504 KB | Output is correct |
18 | Correct | 15 ms | 8056 KB | Output is correct |
19 | Correct | 14 ms | 7928 KB | Output is correct |
20 | Correct | 14 ms | 7868 KB | Output is correct |
21 | Correct | 15 ms | 8056 KB | Output is correct |
22 | Correct | 14 ms | 7928 KB | Output is correct |
23 | Correct | 14 ms | 7928 KB | Output is correct |
24 | Correct | 16 ms | 8056 KB | Output is correct |
25 | Correct | 14 ms | 7928 KB | Output is correct |
26 | Correct | 14 ms | 7928 KB | Output is correct |
27 | Correct | 473 ms | 87452 KB | Output is correct |
28 | Correct | 23 ms | 26104 KB | Output is correct |
29 | Correct | 24 ms | 7792 KB | Output is correct |
30 | Correct | 3 ms | 632 KB | Output is correct |
31 | Correct | 351 ms | 72572 KB | Output is correct |
32 | Correct | 479 ms | 88440 KB | Output is correct |
33 | Correct | 486 ms | 88280 KB | Output is correct |
34 | Correct | 445 ms | 84400 KB | Output is correct |
35 | Correct | 471 ms | 88632 KB | Output is correct |
36 | Correct | 482 ms | 88404 KB | Output is correct |
37 | Correct | 520 ms | 88564 KB | Output is correct |
38 | Correct | 325 ms | 72720 KB | Output is correct |
39 | Correct | 322 ms | 72260 KB | Output is correct |