Submission #701462

# Submission time Handle Problem Language Result Execution time Memory
701462 2023-02-21T09:48:46 Z Dan4Life Bitaro the Brave (JOI19_ho_t1) C++17
100 / 100
283 ms 160200 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define all(a) a.begin(),a.end()
const int mxN = (int)3e3+10;
string a[mxN];
int n, m, ans, r[mxN][mxN], c[mxN][mxN];

int32_t main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    cin >> n >> m;
    for(int i = 0; i < n; i++){
        cin >> a[i];
        for(int j = m-1; j>=0; j--)
            r[i][j]=r[i][j+1]+(a[i][j]=='O');
    }
    for(int j = 0; j < m; j++)
        for(int i = n-1; i>=0; i--)
            c[i][j]=c[i+1][j]+(a[i][j]=='I');
    for(int i = 0; i < n; i++)
        for(int j = 0; j < m; j++)
            if(a[i][j]=='J') ans+=r[i][j+1]*c[i+1][j];
    cout << ans;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 468 KB Output is correct
5 Correct 1 ms 1364 KB Output is correct
6 Correct 1 ms 1364 KB Output is correct
7 Correct 1 ms 1236 KB Output is correct
8 Correct 1 ms 1364 KB Output is correct
9 Correct 1 ms 1364 KB Output is correct
10 Correct 1 ms 1236 KB Output is correct
11 Correct 1 ms 1364 KB Output is correct
12 Correct 1 ms 1364 KB Output is correct
13 Correct 1 ms 1236 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 468 KB Output is correct
5 Correct 1 ms 1364 KB Output is correct
6 Correct 1 ms 1364 KB Output is correct
7 Correct 1 ms 1236 KB Output is correct
8 Correct 1 ms 1364 KB Output is correct
9 Correct 1 ms 1364 KB Output is correct
10 Correct 1 ms 1236 KB Output is correct
11 Correct 1 ms 1364 KB Output is correct
12 Correct 1 ms 1364 KB Output is correct
13 Correct 1 ms 1236 KB Output is correct
14 Correct 6 ms 7636 KB Output is correct
15 Correct 2 ms 3796 KB Output is correct
16 Correct 3 ms 4564 KB Output is correct
17 Correct 1 ms 468 KB Output is correct
18 Correct 7 ms 8532 KB Output is correct
19 Correct 6 ms 8404 KB Output is correct
20 Correct 8 ms 8432 KB Output is correct
21 Correct 6 ms 8532 KB Output is correct
22 Correct 5 ms 8404 KB Output is correct
23 Correct 6 ms 8404 KB Output is correct
24 Correct 8 ms 8532 KB Output is correct
25 Correct 6 ms 8392 KB Output is correct
26 Correct 6 ms 8404 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 468 KB Output is correct
5 Correct 1 ms 1364 KB Output is correct
6 Correct 1 ms 1364 KB Output is correct
7 Correct 1 ms 1236 KB Output is correct
8 Correct 1 ms 1364 KB Output is correct
9 Correct 1 ms 1364 KB Output is correct
10 Correct 1 ms 1236 KB Output is correct
11 Correct 1 ms 1364 KB Output is correct
12 Correct 1 ms 1364 KB Output is correct
13 Correct 1 ms 1236 KB Output is correct
14 Correct 6 ms 7636 KB Output is correct
15 Correct 2 ms 3796 KB Output is correct
16 Correct 3 ms 4564 KB Output is correct
17 Correct 1 ms 468 KB Output is correct
18 Correct 7 ms 8532 KB Output is correct
19 Correct 6 ms 8404 KB Output is correct
20 Correct 8 ms 8432 KB Output is correct
21 Correct 6 ms 8532 KB Output is correct
22 Correct 5 ms 8404 KB Output is correct
23 Correct 6 ms 8404 KB Output is correct
24 Correct 8 ms 8532 KB Output is correct
25 Correct 6 ms 8392 KB Output is correct
26 Correct 6 ms 8404 KB Output is correct
27 Correct 254 ms 156028 KB Output is correct
28 Correct 9 ms 19592 KB Output is correct
29 Correct 11 ms 13868 KB Output is correct
30 Correct 1 ms 852 KB Output is correct
31 Correct 186 ms 130876 KB Output is correct
32 Correct 283 ms 160028 KB Output is correct
33 Correct 226 ms 159776 KB Output is correct
34 Correct 226 ms 151900 KB Output is correct
35 Correct 235 ms 160136 KB Output is correct
36 Correct 232 ms 159740 KB Output is correct
37 Correct 258 ms 160200 KB Output is correct
38 Correct 164 ms 130068 KB Output is correct
39 Correct 169 ms 130460 KB Output is correct