답안 #366809

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
366809 2021-02-15T10:16:15 Z Ruxandra985 Bomb (IZhO17_bomb) C++14
4 / 100
93 ms 12652 KB
#include <bits/stdc++.h>

using namespace std;
char a[2510][2510];
int main()
{
    FILE *fin = stdin;
    FILE *fout = stdout;
    int n , m , i , j , miniw , minih , lenc;
    fscanf (fin,"%d%d\n",&n,&m);
    for (i = 1 ; i <= n ; i++){
        for (j = 1 ; j <= m ; j++)
            a[i][j] = fgetc(fin);
        fgetc(fin);
    }
    miniw = m + 10;
    for (i = 1 ; i <= n ; i++){

        lenc = 0;

        for (j = 1 ; j <= m ; j++){

            if (a[i][j] == '0'){
                if (lenc)
                    miniw = min(miniw , lenc);
                lenc = 0;
            }
            else lenc++;

        }

        if (lenc)
            miniw = min(miniw , lenc);

    }

    minih = n + 10;
    for (j = 1 ; j <= m ; j++){

        lenc = 0;

        for (i = 1 ; i <= n ; i++){

            if (a[i][j] == '0'){
                if (lenc)
                    minih = min(minih , lenc);
                lenc = 0;
            }
            else lenc++;

        }

        if (lenc)
            minih = min(minih , lenc);

    }

    fprintf (fout,"%d", miniw * minih);

    return 0;
}

Compilation message

bomb.cpp: In function 'int main()':
bomb.cpp:10:12: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   10 |     fscanf (fin,"%d%d\n",&n,&m);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 1 ms 364 KB Output isn't correct
3 Incorrect 4 ms 6508 KB Output isn't correct
4 Incorrect 4 ms 6508 KB Output isn't correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Incorrect 1 ms 364 KB Output isn't correct
8 Incorrect 1 ms 364 KB Output isn't correct
9 Incorrect 1 ms 364 KB Output isn't correct
10 Incorrect 1 ms 364 KB Output isn't correct
11 Incorrect 1 ms 512 KB Output isn't correct
12 Incorrect 1 ms 364 KB Output isn't correct
13 Incorrect 1 ms 364 KB Output isn't correct
14 Incorrect 1 ms 364 KB Output isn't correct
15 Incorrect 1 ms 364 KB Output isn't correct
16 Incorrect 1 ms 364 KB Output isn't correct
17 Incorrect 1 ms 492 KB Output isn't correct
18 Incorrect 1 ms 504 KB Output isn't correct
19 Incorrect 1 ms 620 KB Output isn't correct
20 Incorrect 1 ms 492 KB Output isn't correct
21 Incorrect 1 ms 492 KB Output isn't correct
22 Incorrect 1 ms 512 KB Output isn't correct
23 Incorrect 1 ms 620 KB Output isn't correct
24 Incorrect 1 ms 492 KB Output isn't correct
25 Incorrect 1 ms 620 KB Output isn't correct
26 Incorrect 1 ms 620 KB Output isn't correct
27 Incorrect 1 ms 1132 KB Output isn't correct
28 Incorrect 2 ms 1132 KB Output isn't correct
29 Incorrect 2 ms 1388 KB Output isn't correct
30 Incorrect 2 ms 1516 KB Output isn't correct
31 Incorrect 3 ms 1260 KB Output isn't correct
32 Incorrect 2 ms 1516 KB Output isn't correct
33 Incorrect 3 ms 1644 KB Output isn't correct
34 Incorrect 2 ms 1260 KB Output isn't correct
35 Incorrect 3 ms 1644 KB Output isn't correct
36 Incorrect 2 ms 1644 KB Output isn't correct
37 Incorrect 1 ms 364 KB Output isn't correct
38 Correct 70 ms 12524 KB Output is correct
39 Incorrect 1 ms 364 KB Output isn't correct
40 Incorrect 6 ms 3180 KB Output isn't correct
41 Incorrect 1 ms 364 KB Output isn't correct
42 Incorrect 1 ms 620 KB Output isn't correct
43 Incorrect 70 ms 12524 KB Output isn't correct
44 Incorrect 2 ms 1644 KB Output isn't correct
45 Incorrect 75 ms 12652 KB Output isn't correct
46 Incorrect 74 ms 12524 KB Output isn't correct
47 Incorrect 73 ms 12524 KB Output isn't correct
48 Incorrect 73 ms 12524 KB Output isn't correct
49 Incorrect 83 ms 12652 KB Output isn't correct
50 Incorrect 68 ms 12652 KB Output isn't correct
51 Incorrect 70 ms 12524 KB Output isn't correct
52 Incorrect 65 ms 12652 KB Output isn't correct
53 Incorrect 68 ms 12524 KB Output isn't correct
54 Incorrect 82 ms 12524 KB Output isn't correct
55 Incorrect 71 ms 12524 KB Output isn't correct
56 Incorrect 64 ms 12524 KB Output isn't correct
57 Incorrect 73 ms 12524 KB Output isn't correct
58 Incorrect 69 ms 12524 KB Output isn't correct
59 Incorrect 66 ms 12524 KB Output isn't correct
60 Incorrect 70 ms 12652 KB Output isn't correct
61 Incorrect 63 ms 12524 KB Output isn't correct
62 Incorrect 63 ms 12524 KB Output isn't correct
63 Incorrect 68 ms 12524 KB Output isn't correct
64 Incorrect 67 ms 12524 KB Output isn't correct
65 Incorrect 64 ms 12632 KB Output isn't correct
66 Incorrect 68 ms 12652 KB Output isn't correct
67 Incorrect 63 ms 12524 KB Output isn't correct
68 Incorrect 61 ms 12524 KB Output isn't correct
69 Incorrect 67 ms 12524 KB Output isn't correct
70 Incorrect 33 ms 9196 KB Output isn't correct
71 Incorrect 68 ms 12524 KB Output isn't correct
72 Incorrect 74 ms 12524 KB Output isn't correct
73 Incorrect 80 ms 12524 KB Output isn't correct
74 Incorrect 66 ms 12652 KB Output isn't correct
75 Incorrect 65 ms 12524 KB Output isn't correct
76 Incorrect 62 ms 12524 KB Output isn't correct
77 Incorrect 60 ms 12544 KB Output isn't correct
78 Incorrect 64 ms 12524 KB Output isn't correct
79 Incorrect 65 ms 12524 KB Output isn't correct
80 Incorrect 93 ms 12552 KB Output isn't correct
81 Incorrect 78 ms 12652 KB Output isn't correct
82 Incorrect 75 ms 12652 KB Output isn't correct
83 Incorrect 73 ms 12524 KB Output isn't correct
84 Incorrect 78 ms 12524 KB Output isn't correct
85 Incorrect 74 ms 12524 KB Output isn't correct
86 Incorrect 76 ms 12652 KB Output isn't correct
87 Incorrect 74 ms 12544 KB Output isn't correct
88 Incorrect 73 ms 12624 KB Output isn't correct
89 Incorrect 70 ms 12652 KB Output isn't correct
90 Incorrect 32 ms 9196 KB Output isn't correct
91 Incorrect 72 ms 12640 KB Output isn't correct
92 Incorrect 66 ms 12524 KB Output isn't correct
93 Incorrect 67 ms 12524 KB Output isn't correct
94 Incorrect 70 ms 12640 KB Output isn't correct
95 Incorrect 86 ms 12524 KB Output isn't correct
96 Incorrect 74 ms 12652 KB Output isn't correct
97 Incorrect 74 ms 12524 KB Output isn't correct
98 Incorrect 73 ms 12524 KB Output isn't correct
99 Incorrect 85 ms 12524 KB Output isn't correct
100 Incorrect 70 ms 12524 KB Output isn't correct