답안 #225979

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
225979 2020-04-22T07:31:22 Z Ruxandra985 Bitaro the Brave (JOI19_ho_t1) C++14
100 / 100
259 ms 88568 KB
#include <bits/stdc++.h>

using namespace std;
char s[3010][3010];
long long sol[3010][3010];
int main()
{
    FILE *fin = stdin;
    FILE *fout = stdout;
    int n , m , i , j;
    long long 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,"%lld",cnt);
    return 0;
}

Compilation message

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:12: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:14: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);
         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 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 6 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 5 ms 1024 KB Output is correct
11 Correct 5 ms 1024 KB Output is correct
12 Correct 6 ms 1024 KB Output is correct
13 Correct 5 ms 1024 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 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 6 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 5 ms 1024 KB Output is correct
11 Correct 5 ms 1024 KB Output is correct
12 Correct 6 ms 1024 KB Output is correct
13 Correct 5 ms 1024 KB Output is correct
14 Correct 12 ms 5248 KB Output is correct
15 Correct 6 ms 3200 KB Output is correct
16 Correct 6 ms 2688 KB Output is correct
17 Correct 5 ms 384 KB Output is correct
18 Correct 12 ms 5760 KB Output is correct
19 Correct 8 ms 4864 KB Output is correct
20 Correct 8 ms 4352 KB Output is correct
21 Correct 12 ms 6016 KB Output is correct
22 Correct 8 ms 5376 KB Output is correct
23 Correct 8 ms 4608 KB Output is correct
24 Correct 12 ms 6016 KB Output is correct
25 Correct 9 ms 4992 KB Output is correct
26 Correct 8 ms 4608 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 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 6 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 5 ms 1024 KB Output is correct
11 Correct 5 ms 1024 KB Output is correct
12 Correct 6 ms 1024 KB Output is correct
13 Correct 5 ms 1024 KB Output is correct
14 Correct 12 ms 5248 KB Output is correct
15 Correct 6 ms 3200 KB Output is correct
16 Correct 6 ms 2688 KB Output is correct
17 Correct 5 ms 384 KB Output is correct
18 Correct 12 ms 5760 KB Output is correct
19 Correct 8 ms 4864 KB Output is correct
20 Correct 8 ms 4352 KB Output is correct
21 Correct 12 ms 6016 KB Output is correct
22 Correct 8 ms 5376 KB Output is correct
23 Correct 8 ms 4608 KB Output is correct
24 Correct 12 ms 6016 KB Output is correct
25 Correct 9 ms 4992 KB Output is correct
26 Correct 8 ms 4608 KB Output is correct
27 Correct 257 ms 88188 KB Output is correct
28 Correct 12 ms 16128 KB Output is correct
29 Correct 13 ms 4736 KB Output is correct
30 Correct 5 ms 640 KB Output is correct
31 Correct 195 ms 72696 KB Output is correct
32 Correct 132 ms 66168 KB Output is correct
33 Correct 139 ms 53368 KB Output is correct
34 Correct 223 ms 84216 KB Output is correct
35 Correct 164 ms 72056 KB Output is correct
36 Correct 136 ms 53368 KB Output is correct
37 Correct 259 ms 88568 KB Output is correct
38 Correct 96 ms 50168 KB Output is correct
39 Correct 105 ms 40032 KB Output is correct