Submission #747407

# Submission time Handle Problem Language Result Execution time Memory
747407 2023-05-24T07:00:20 Z Kongggwp Bitaro the Brave (JOI19_ho_t1) C++14
100 / 100
555 ms 88540 KB
#include <bits/stdc++.h>
using namespace std;
const int MxN = 3005;
int n , m , d[MxN][MxN] , r[MxN][MxN];
long long ans;
char grid[MxN][MxN];
int main()
{
    cin >> n >> m;
    for(int i=1 ; i<=n ; i++)for(int j=1 ; j<=m ; j++)cin >> grid[i][j];
    for(int i=n ; i>=1 ; i--)for(int j=1 ; j<=m ; j++)d[i][j] = d[i+1][j] + (grid[i][j]=='I');
    for(int i=1 ; i<=n ; i++)for(int j=m ; j>=1 ; j--)r[i][j] = r[i][j+1] + (grid[i][j]=='O');
    for(int i=1 ; i<=n ; i++)for(int j=1 ; j<=m ; j++)if(grid[i][j]=='J')ans+=d[i][j]*r[i][j];
    cout << ans;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 312 KB Output is correct
5 Correct 2 ms 1492 KB Output is correct
6 Correct 2 ms 1464 KB Output is correct
7 Correct 2 ms 1364 KB Output is correct
8 Correct 2 ms 1492 KB Output is correct
9 Correct 2 ms 1468 KB Output is correct
10 Correct 2 ms 1364 KB Output is correct
11 Correct 2 ms 1492 KB Output is correct
12 Correct 2 ms 1492 KB Output is correct
13 Correct 2 ms 1364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 312 KB Output is correct
5 Correct 2 ms 1492 KB Output is correct
6 Correct 2 ms 1464 KB Output is correct
7 Correct 2 ms 1364 KB Output is correct
8 Correct 2 ms 1492 KB Output is correct
9 Correct 2 ms 1468 KB Output is correct
10 Correct 2 ms 1364 KB Output is correct
11 Correct 2 ms 1492 KB Output is correct
12 Correct 2 ms 1492 KB Output is correct
13 Correct 2 ms 1364 KB Output is correct
14 Correct 15 ms 7444 KB Output is correct
15 Correct 3 ms 4920 KB Output is correct
16 Correct 9 ms 4300 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 19 ms 7856 KB Output is correct
19 Correct 18 ms 7704 KB Output is correct
20 Correct 17 ms 7716 KB Output is correct
21 Correct 19 ms 7968 KB Output is correct
22 Correct 18 ms 7884 KB Output is correct
23 Correct 19 ms 7764 KB Output is correct
24 Correct 19 ms 8020 KB Output is correct
25 Correct 18 ms 7856 KB Output is correct
26 Correct 17 ms 7756 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 312 KB Output is correct
5 Correct 2 ms 1492 KB Output is correct
6 Correct 2 ms 1464 KB Output is correct
7 Correct 2 ms 1364 KB Output is correct
8 Correct 2 ms 1492 KB Output is correct
9 Correct 2 ms 1468 KB Output is correct
10 Correct 2 ms 1364 KB Output is correct
11 Correct 2 ms 1492 KB Output is correct
12 Correct 2 ms 1492 KB Output is correct
13 Correct 2 ms 1364 KB Output is correct
14 Correct 15 ms 7444 KB Output is correct
15 Correct 3 ms 4920 KB Output is correct
16 Correct 9 ms 4300 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 19 ms 7856 KB Output is correct
19 Correct 18 ms 7704 KB Output is correct
20 Correct 17 ms 7716 KB Output is correct
21 Correct 19 ms 7968 KB Output is correct
22 Correct 18 ms 7884 KB Output is correct
23 Correct 19 ms 7764 KB Output is correct
24 Correct 19 ms 8020 KB Output is correct
25 Correct 18 ms 7856 KB Output is correct
26 Correct 17 ms 7756 KB Output is correct
27 Correct 531 ms 87968 KB Output is correct
28 Correct 14 ms 26068 KB Output is correct
29 Correct 42 ms 7756 KB Output is correct
30 Correct 2 ms 584 KB Output is correct
31 Correct 388 ms 72588 KB Output is correct
32 Correct 524 ms 88404 KB Output is correct
33 Correct 548 ms 88088 KB Output is correct
34 Correct 461 ms 84172 KB Output is correct
35 Correct 537 ms 88372 KB Output is correct
36 Correct 524 ms 88140 KB Output is correct
37 Correct 555 ms 88540 KB Output is correct
38 Correct 376 ms 72480 KB Output is correct
39 Correct 373 ms 72224 KB Output is correct