Submission #127442

# Submission time Handle Problem Language Result Execution time Memory
127442 2019-07-09T11:34:51 Z arnold518 Bitaro the Brave (JOI19_ho_t1) C++14
20 / 100
13 ms 8056 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], 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("%d", ans);
}

Compilation message

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:17: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:18:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(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 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 7544 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 376 KB Output is correct
18 Correct 13 ms 8056 KB Output is correct
19 Correct 12 ms 7928 KB Output is correct
20 Incorrect 11 ms 7928 KB Output isn't correct
21 Halted 0 ms 0 KB -
# 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 7544 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 376 KB Output is correct
18 Correct 13 ms 8056 KB Output is correct
19 Correct 12 ms 7928 KB Output is correct
20 Incorrect 11 ms 7928 KB Output isn't correct
21 Halted 0 ms 0 KB -