Submission #225978

# Submission time Handle Problem Language Result Execution time Memory
225978 2020-04-22T07:30:07 Z Ruxandra985 Bitaro the Brave (JOI19_ho_t1) C++14
20 / 100
12 ms 4992 KB
#include <bits/stdc++.h>

using namespace std;
char s[3010][3010];
int sol[3010][3010];
int main()
{
    FILE *fin = stdin;
    FILE *fout = stdout;
    int n , m , i , j , cnt;
    fscanf (fin,"%d%d\n",&n,&m);
    for (i = 1 ; i <= n ; i++){
        fgets (s[i] + 1 , 3010 , fin);
    }

    for (i = 1 ; i <= n ; i++){
        cnt = 0;
        for (j = m ; j ; j--){
            if (s[i][j] == 'O')
                cnt++;
            else if (s[i][j] == 'J'){
                sol[i][j] = cnt;
            }
        }

    }


    for (j = 1 ; j <= m ; j++){
        cnt = 0;
        for (i = n ; i ; i--){
            if (s[i][j] == 'I')
                cnt++;
            else if (s[i][j] == 'J'){
                sol[i][j] *= cnt;
            }
        }

    }

    cnt = 0;

    for (i = 1 ; i <= n ; i++){
        for (j = 1 ; j <= m ; j++)
            cnt += sol[i][j];
    }
    fprintf (fout,"%d",cnt);
    return 0;
}

Compilation message

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:11:12: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     fscanf (fin,"%d%d\n",&n,&m);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~
joi2019_ho_t1.cpp:13:15: warning: ignoring return value of 'char* fgets(char*, int, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
         fgets (s[i] + 1 , 3010 , fin);
         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 4 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 5 ms 1024 KB Output is correct
6 Correct 5 ms 1024 KB Output is correct
7 Correct 5 ms 1024 KB Output is correct
8 Correct 5 ms 1024 KB Output is correct
9 Correct 5 ms 1024 KB Output is correct
10 Correct 6 ms 1024 KB Output is correct
11 Correct 5 ms 1024 KB Output is correct
12 Correct 5 ms 1024 KB Output is correct
13 Correct 5 ms 1024 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 4 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 5 ms 1024 KB Output is correct
6 Correct 5 ms 1024 KB Output is correct
7 Correct 5 ms 1024 KB Output is correct
8 Correct 5 ms 1024 KB Output is correct
9 Correct 5 ms 1024 KB Output is correct
10 Correct 6 ms 1024 KB Output is correct
11 Correct 5 ms 1024 KB Output is correct
12 Correct 5 ms 1024 KB Output is correct
13 Correct 5 ms 1024 KB Output is correct
14 Correct 10 ms 4736 KB Output is correct
15 Correct 6 ms 3192 KB Output is correct
16 Correct 6 ms 2560 KB Output is correct
17 Correct 5 ms 384 KB Output is correct
18 Correct 12 ms 4992 KB Output is correct
19 Correct 7 ms 4480 KB Output is correct
20 Incorrect 7 ms 4224 KB Output isn't correct
21 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 4 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 5 ms 1024 KB Output is correct
6 Correct 5 ms 1024 KB Output is correct
7 Correct 5 ms 1024 KB Output is correct
8 Correct 5 ms 1024 KB Output is correct
9 Correct 5 ms 1024 KB Output is correct
10 Correct 6 ms 1024 KB Output is correct
11 Correct 5 ms 1024 KB Output is correct
12 Correct 5 ms 1024 KB Output is correct
13 Correct 5 ms 1024 KB Output is correct
14 Correct 10 ms 4736 KB Output is correct
15 Correct 6 ms 3192 KB Output is correct
16 Correct 6 ms 2560 KB Output is correct
17 Correct 5 ms 384 KB Output is correct
18 Correct 12 ms 4992 KB Output is correct
19 Correct 7 ms 4480 KB Output is correct
20 Incorrect 7 ms 4224 KB Output isn't correct
21 Halted 0 ms 0 KB -