답안 #169606

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
169606 2019-12-21T14:21:21 Z SamAnd Bomb (IZhO17_bomb) C++17
24 / 100
117 ms 13944 KB
#include <bits/stdc++.h>
using namespace std;
const int N = 3003;

int n, m;
char a[N][N];

int main()
{
    scanf("%d%d", &n, &m);
    for (int i = 0; i < n; ++i)
        scanf(" %s", a[i]);
    int nn = n, mm = m;
    for (int i = 0; i < n; ++i)
    {
        int q = 0;
        for (int j = 0; j < m; ++j)
        {
            if (a[i][j] == '1')
                ++q;
            else
            {
                if (q)
                    mm = min(mm, q);
                q = 0;
            }
        }
        if (q)
            mm = min(mm, q);
    }
    for (int j = 0; j < m; ++j)
    {
        int q = 0;
        for (int i = 0; i < n; ++i)
        {
            if (a[i][j] == '1')
                ++q;
            else
            {
                if (q)
                    nn = min(nn, q);
                q = 0;
            }
        }
        if (q)
            nn = min(nn, q);
    }
    printf("%d\n", nn * mm);
    return 0;
}

Compilation message

bomb.cpp: In function 'int main()':
bomb.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d", &n, &m);
     ~~~~~^~~~~~~~~~~~~~~~
bomb.cpp:12:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf(" %s", a[i]);
         ~~~~~^~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 8 ms 7676 KB Output is correct
4 Correct 8 ms 7672 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Incorrect 2 ms 376 KB Output isn't correct
9 Incorrect 2 ms 376 KB Output isn't correct
10 Incorrect 2 ms 376 KB Output isn't correct
11 Incorrect 2 ms 376 KB Output isn't correct
12 Incorrect 2 ms 376 KB Output isn't correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Incorrect 2 ms 376 KB Output isn't correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 504 KB Output is correct
18 Incorrect 3 ms 504 KB Output isn't correct
19 Incorrect 2 ms 632 KB Output isn't correct
20 Incorrect 2 ms 632 KB Output isn't correct
21 Incorrect 2 ms 504 KB Output isn't correct
22 Incorrect 2 ms 504 KB Output isn't correct
23 Incorrect 2 ms 632 KB Output isn't correct
24 Incorrect 2 ms 504 KB Output isn't correct
25 Incorrect 2 ms 632 KB Output isn't correct
26 Correct 2 ms 632 KB Output is correct
27 Correct 3 ms 1260 KB Output is correct
28 Incorrect 3 ms 1272 KB Output isn't correct
29 Incorrect 4 ms 1528 KB Output isn't correct
30 Incorrect 4 ms 1784 KB Output isn't correct
31 Incorrect 4 ms 1528 KB Output isn't correct
32 Incorrect 4 ms 1656 KB Output isn't correct
33 Incorrect 4 ms 1912 KB Output isn't correct
34 Incorrect 3 ms 1400 KB Output isn't correct
35 Incorrect 4 ms 1912 KB Output isn't correct
36 Correct 4 ms 1916 KB Output is correct
37 Incorrect 2 ms 376 KB Output isn't correct
38 Correct 59 ms 13944 KB Output is correct
39 Incorrect 2 ms 376 KB Output isn't correct
40 Incorrect 9 ms 3704 KB Output isn't correct
41 Incorrect 2 ms 376 KB Output isn't correct
42 Incorrect 2 ms 632 KB Output isn't correct
43 Correct 58 ms 13772 KB Output is correct
44 Incorrect 4 ms 1784 KB Output isn't correct
45 Incorrect 57 ms 13816 KB Output isn't correct
46 Correct 65 ms 13820 KB Output is correct
47 Incorrect 56 ms 13820 KB Output isn't correct
48 Incorrect 59 ms 13816 KB Output isn't correct
49 Correct 60 ms 13808 KB Output is correct
50 Incorrect 59 ms 13816 KB Output isn't correct
51 Incorrect 59 ms 13792 KB Output isn't correct
52 Incorrect 55 ms 13820 KB Output isn't correct
53 Incorrect 57 ms 13820 KB Output isn't correct
54 Incorrect 56 ms 13800 KB Output isn't correct
55 Incorrect 57 ms 13816 KB Output isn't correct
56 Correct 60 ms 13828 KB Output is correct
57 Incorrect 56 ms 13816 KB Output isn't correct
58 Incorrect 56 ms 13816 KB Output isn't correct
59 Incorrect 56 ms 13816 KB Output isn't correct
60 Correct 59 ms 13816 KB Output is correct
61 Correct 61 ms 13912 KB Output is correct
62 Correct 58 ms 13816 KB Output is correct
63 Correct 59 ms 13788 KB Output is correct
64 Correct 56 ms 13816 KB Output is correct
65 Incorrect 57 ms 13752 KB Output isn't correct
66 Incorrect 57 ms 13816 KB Output isn't correct
67 Incorrect 59 ms 13816 KB Output isn't correct
68 Incorrect 59 ms 13816 KB Output isn't correct
69 Incorrect 55 ms 13772 KB Output isn't correct
70 Incorrect 33 ms 10104 KB Output isn't correct
71 Incorrect 57 ms 13788 KB Output isn't correct
72 Incorrect 56 ms 13816 KB Output isn't correct
73 Incorrect 58 ms 13708 KB Output isn't correct
74 Incorrect 56 ms 13816 KB Output isn't correct
75 Incorrect 59 ms 13912 KB Output isn't correct
76 Incorrect 56 ms 13816 KB Output isn't correct
77 Incorrect 56 ms 13828 KB Output isn't correct
78 Incorrect 57 ms 13816 KB Output isn't correct
79 Incorrect 54 ms 13816 KB Output isn't correct
80 Incorrect 56 ms 13816 KB Output isn't correct
81 Incorrect 56 ms 13852 KB Output isn't correct
82 Incorrect 58 ms 13864 KB Output isn't correct
83 Incorrect 58 ms 13944 KB Output isn't correct
84 Incorrect 55 ms 13816 KB Output isn't correct
85 Incorrect 57 ms 13816 KB Output isn't correct
86 Incorrect 58 ms 13824 KB Output isn't correct
87 Incorrect 54 ms 13856 KB Output isn't correct
88 Incorrect 58 ms 13820 KB Output isn't correct
89 Incorrect 117 ms 13944 KB Output isn't correct
90 Incorrect 31 ms 10104 KB Output isn't correct
91 Incorrect 58 ms 13816 KB Output isn't correct
92 Incorrect 54 ms 13816 KB Output isn't correct
93 Incorrect 60 ms 13816 KB Output isn't correct
94 Incorrect 59 ms 13864 KB Output isn't correct
95 Incorrect 59 ms 13820 KB Output isn't correct
96 Incorrect 57 ms 13816 KB Output isn't correct
97 Incorrect 59 ms 13816 KB Output isn't correct
98 Incorrect 56 ms 13820 KB Output isn't correct
99 Incorrect 56 ms 13816 KB Output isn't correct
100 Incorrect 57 ms 13816 KB Output isn't correct