Submission #165140

# Submission time Handle Problem Language Result Execution time Memory
165140 2019-11-25T10:37:42 Z Akashi Bitaro the Brave (JOI19_ho_t1) C++14
100 / 100
152 ms 88504 KB
#include <bits/stdc++.h>
using namespace std;

int n, m;
char s[3005][3005];
int l[3005][3005], c[3005][3005];
int main()
{
//    freopen("1.in", "r", stdin);

    scanf("%d%d", &n, &m);
    for(int i = 1; i <= n ; ++i) scanf("%s", s[i] + 1);

    long long Sol = 0;
    for(int i = n; i >= 1 ; --i){
        for(int j = m; j >= 1 ; --j){
            c[i][j] = c[i][j + 1] + (s[i][j] == 'O');
            l[i][j] = l[i + 1][j] + (s[i][j] == 'I');

            if(s[i][j] == 'J') Sol = Sol + 1LL * l[i][j] * c[i][j];
        }
    }

    printf("%lld", Sol);

    return 0;
}

Compilation message

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d", &n, &m);
     ~~~~~^~~~~~~~~~~~~~~~
joi2019_ho_t1.cpp:12:39: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(int i = 1; i <= n ; ++i) scanf("%s", s[i] + 1);
                                  ~~~~~^~~~~~~~~~~~~~~~
# 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 376 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 1500 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 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 376 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 1500 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 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 10 ms 7416 KB Output is correct
15 Correct 6 ms 4984 KB Output is correct
16 Correct 7 ms 4344 KB Output is correct
17 Correct 2 ms 504 KB Output is correct
18 Correct 11 ms 8028 KB Output is correct
19 Correct 12 ms 7928 KB Output is correct
20 Correct 10 ms 7928 KB Output is correct
21 Correct 11 ms 7928 KB Output is correct
22 Correct 10 ms 7932 KB Output is correct
23 Correct 10 ms 7800 KB Output is correct
24 Correct 13 ms 7928 KB Output is correct
25 Correct 16 ms 7928 KB Output is correct
26 Correct 10 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 376 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 1500 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 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 10 ms 7416 KB Output is correct
15 Correct 6 ms 4984 KB Output is correct
16 Correct 7 ms 4344 KB Output is correct
17 Correct 2 ms 504 KB Output is correct
18 Correct 11 ms 8028 KB Output is correct
19 Correct 12 ms 7928 KB Output is correct
20 Correct 10 ms 7928 KB Output is correct
21 Correct 11 ms 7928 KB Output is correct
22 Correct 10 ms 7932 KB Output is correct
23 Correct 10 ms 7800 KB Output is correct
24 Correct 13 ms 7928 KB Output is correct
25 Correct 16 ms 7928 KB Output is correct
26 Correct 10 ms 7800 KB Output is correct
27 Correct 137 ms 87972 KB Output is correct
28 Correct 28 ms 26184 KB Output is correct
29 Correct 13 ms 7800 KB Output is correct
30 Correct 3 ms 632 KB Output is correct
31 Correct 112 ms 72696 KB Output is correct
32 Correct 121 ms 88440 KB Output is correct
33 Correct 126 ms 88300 KB Output is correct
34 Correct 125 ms 84232 KB Output is correct
35 Correct 116 ms 88440 KB Output is correct
36 Correct 145 ms 88184 KB Output is correct
37 Correct 152 ms 88504 KB Output is correct
38 Correct 94 ms 72568 KB Output is correct
39 Correct 121 ms 72332 KB Output is correct