답안 #1030384

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1030384 2024-07-22T04:17:19 Z caterpillow Bomb (IZhO17_bomb) C++17
24 / 100
186 ms 6232 KB
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
#define vt vector
#define f first
#define s second
#define all(x) (x).begin(), (x).end()
#define FOR(i, a, b)  for (int i = (a); i < (b); i++)
#define F0R(i, b) FOR(i, 0, b)
#define ROF(i, a, b) for (int i = (b) - 1; i >= (a); i--)
#define pb push_back
#define endl '\n'

#ifndef LOCAL
#define cerr if (0) std::cerr
#endif

/*

N^3: find max width for each given height

*/

int rs, cs;
vt<vt<bool>> grid;

main() {
    cin.tie(0)->sync_with_stdio();

    cin >> rs >> cs;
    rs += 2, cs += 2;
    grid.resize(rs, vt<bool>(cs));
    FOR (r, 1, rs - 1) {
        FOR (c, 1, cs - 1) {
            char ch; cin >> ch;
            grid[r][c] = ch - '0';
        }
    }

    int mxw = cs, mxh = rs;
    F0R (r, rs) {
        int streak = 0;
        F0R (c, cs) {
            if (grid[r][c]) streak++;
            else if (streak) mxw = min(mxw, streak), streak = 0;
        }
    }
    F0R (c, cs) {
        int streak = 0;
        F0R (r, rs) {
            if (grid[r][c]) streak++;
            else if (streak) mxh = min(mxh, streak), streak = 0;
        }
    }

    cout << mxw * mxh << endl;
}

Compilation message

bomb.cpp:29:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   29 | main() {
      | ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 436 KB Output is correct
3 Correct 1 ms 604 KB Output is correct
4 Correct 0 ms 604 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Incorrect 0 ms 348 KB Output isn't correct
9 Incorrect 0 ms 348 KB Output isn't correct
10 Incorrect 0 ms 352 KB Output isn't correct
11 Incorrect 0 ms 348 KB Output isn't correct
12 Incorrect 0 ms 348 KB Output isn't correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 344 KB Output is correct
15 Incorrect 0 ms 344 KB Output isn't correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Incorrect 0 ms 348 KB Output isn't correct
19 Incorrect 1 ms 348 KB Output isn't correct
20 Incorrect 0 ms 348 KB Output isn't correct
21 Incorrect 0 ms 348 KB Output isn't correct
22 Incorrect 0 ms 348 KB Output isn't correct
23 Incorrect 1 ms 604 KB Output isn't correct
24 Incorrect 0 ms 348 KB Output isn't correct
25 Incorrect 0 ms 348 KB Output isn't correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 2 ms 344 KB Output is correct
28 Incorrect 4 ms 512 KB Output isn't correct
29 Incorrect 3 ms 592 KB Output isn't correct
30 Incorrect 4 ms 604 KB Output isn't correct
31 Incorrect 5 ms 616 KB Output isn't correct
32 Incorrect 5 ms 624 KB Output isn't correct
33 Incorrect 4 ms 600 KB Output isn't correct
34 Incorrect 2 ms 440 KB Output isn't correct
35 Incorrect 4 ms 604 KB Output isn't correct
36 Correct 6 ms 600 KB Output is correct
37 Incorrect 0 ms 348 KB Output isn't correct
38 Correct 134 ms 6180 KB Output is correct
39 Incorrect 0 ms 348 KB Output isn't correct
40 Incorrect 16 ms 1116 KB Output isn't correct
41 Incorrect 1 ms 348 KB Output isn't correct
42 Incorrect 1 ms 348 KB Output isn't correct
43 Correct 156 ms 6024 KB Output is correct
44 Incorrect 4 ms 604 KB Output isn't correct
45 Incorrect 126 ms 6152 KB Output isn't correct
46 Correct 134 ms 6052 KB Output is correct
47 Incorrect 125 ms 5976 KB Output isn't correct
48 Incorrect 186 ms 5972 KB Output isn't correct
49 Correct 183 ms 6196 KB Output is correct
50 Incorrect 154 ms 5968 KB Output isn't correct
51 Incorrect 164 ms 5976 KB Output isn't correct
52 Incorrect 145 ms 6232 KB Output isn't correct
53 Incorrect 134 ms 5968 KB Output isn't correct
54 Incorrect 141 ms 6168 KB Output isn't correct
55 Incorrect 128 ms 6084 KB Output isn't correct
56 Correct 158 ms 6192 KB Output is correct
57 Incorrect 164 ms 5968 KB Output isn't correct
58 Incorrect 130 ms 5972 KB Output isn't correct
59 Incorrect 137 ms 6052 KB Output isn't correct
60 Correct 161 ms 5972 KB Output is correct
61 Correct 124 ms 5972 KB Output is correct
62 Correct 125 ms 6052 KB Output is correct
63 Correct 163 ms 6228 KB Output is correct
64 Correct 123 ms 5972 KB Output is correct
65 Incorrect 127 ms 6180 KB Output isn't correct
66 Incorrect 122 ms 6188 KB Output isn't correct
67 Incorrect 124 ms 6168 KB Output isn't correct
68 Incorrect 126 ms 6060 KB Output isn't correct
69 Incorrect 122 ms 5968 KB Output isn't correct
70 Incorrect 80 ms 4176 KB Output isn't correct
71 Incorrect 127 ms 5972 KB Output isn't correct
72 Incorrect 135 ms 5972 KB Output isn't correct
73 Incorrect 122 ms 5968 KB Output isn't correct
74 Incorrect 127 ms 6048 KB Output isn't correct
75 Incorrect 122 ms 5972 KB Output isn't correct
76 Incorrect 123 ms 5972 KB Output isn't correct
77 Incorrect 123 ms 5968 KB Output isn't correct
78 Incorrect 143 ms 6156 KB Output isn't correct
79 Incorrect 122 ms 4432 KB Output isn't correct
80 Incorrect 159 ms 4436 KB Output isn't correct
81 Incorrect 125 ms 4436 KB Output isn't correct
82 Incorrect 121 ms 4432 KB Output isn't correct
83 Incorrect 122 ms 4436 KB Output isn't correct
84 Incorrect 122 ms 4532 KB Output isn't correct
85 Incorrect 121 ms 4432 KB Output isn't correct
86 Incorrect 121 ms 4432 KB Output isn't correct
87 Incorrect 159 ms 1332 KB Output isn't correct
88 Incorrect 122 ms 1116 KB Output isn't correct
89 Incorrect 120 ms 1112 KB Output isn't correct
90 Incorrect 83 ms 1036 KB Output isn't correct
91 Incorrect 122 ms 1328 KB Output isn't correct
92 Incorrect 154 ms 1116 KB Output isn't correct
93 Incorrect 121 ms 1112 KB Output isn't correct
94 Incorrect 123 ms 1116 KB Output isn't correct
95 Incorrect 122 ms 1116 KB Output isn't correct
96 Incorrect 121 ms 1116 KB Output isn't correct
97 Incorrect 124 ms 1116 KB Output isn't correct
98 Incorrect 131 ms 1332 KB Output isn't correct
99 Incorrect 121 ms 1328 KB Output isn't correct
100 Incorrect 121 ms 1112 KB Output isn't correct