Submission #38385

# Submission time Handle Problem Language Result Execution time Memory
38385 2018-01-04T04:47:03 Z Just_Solve_The_Problem Bomb (IZhO17_bomb) C++11
2 / 100
1000 ms 14272 KB
#include <bits/stdc++.h>

using namespace std;

const int N = (int)2505;

char c[N][N];
char ex[N][N];

main () {
    bool fl = 1;
    int n, m; scanf ("%d %d", &n, &m);
    for (int i = 1; i < N; i++)
        for (int j = 1; j < N; j++)
            c[i][j] = '0';
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            char ss; ss = getchar();
            if (ss == '\n')
                j--;
            else {
                c[i][j] = ss;
                if (ss == '1') fl = 0;
            }
        }
    }
    if (fl) {
        puts("0");
        return 0;
    }
    int ans = 0;
    for (int h = 1; h <= n; h++) {
        for (int w = 1; w <= m; w++) {
            for (int i = 1; i <= n + 1; i++)
                for (int j = 1; j <= m + 1; j++)
                    ex[i][j] = c[i][j];

            bool can = 1;
            for (int i = 1; i <= n; i++) {
                for (int j = 1; j <= m; j++) {
                    can = 1;
                    for (int curi = i, k = 0; k < h; k++, curi++) {
                        for (int curj = j, l = 0; l < w; l++, curj++) {
                            if (ex[curi][curj] == '0') {
                                can = 0;
                                l = w; k = h;
                            }
                        }
                    }
                    if (can) {
                        for (int curi = i, k = 0; k < h; k++, curi++) {
                            for (int curj = j, l = 0; l < w; l++, curj++) {
                                if (ex[curi][curj] == '1')
                                    ex[curi][curj] = '2';
                            }
                        }
                    }
                }
            }
            can = 1;
            for (int i = 1; i <= n; i++) {
                for (int j = 1; j <= m; j++) {
                    if (ex[i][j] == '1') can = 0;
                }
            }
            if (can) ans = max(ans, h * w);
        }
    }
    cout << ans;
}

Compilation message

bomb.cpp:10:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main () {
       ^
bomb.cpp: In function 'int main()':
bomb.cpp:12:38: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     int n, m; scanf ("%d %d", &n, &m);
                                      ^
# Verdict Execution time Memory Grader output
1 Correct 3 ms 14272 KB Output is correct
2 Incorrect 3 ms 14272 KB Output isn't correct
3 Execution timed out 1000 ms 14272 KB Execution timed out
4 Execution timed out 1000 ms 14272 KB Execution timed out
5 Execution timed out 1000 ms 14272 KB Execution timed out
6 Incorrect 446 ms 14272 KB Output isn't correct
7 Correct 6 ms 14272 KB Output is correct
8 Incorrect 9 ms 14272 KB Output isn't correct
9 Incorrect 3 ms 14272 KB Output isn't correct
10 Incorrect 6 ms 14272 KB Output isn't correct
11 Incorrect 3 ms 14272 KB Output isn't correct
12 Incorrect 9 ms 14272 KB Output isn't correct
13 Incorrect 6 ms 14272 KB Output isn't correct
14 Incorrect 6 ms 14272 KB Output isn't correct
15 Incorrect 3 ms 14272 KB Output isn't correct
16 Incorrect 9 ms 14272 KB Output isn't correct
17 Incorrect 206 ms 14272 KB Output isn't correct
18 Incorrect 119 ms 14272 KB Output isn't correct
19 Incorrect 443 ms 14272 KB Output isn't correct
20 Incorrect 466 ms 14272 KB Output isn't correct
21 Incorrect 119 ms 14272 KB Output isn't correct
22 Incorrect 286 ms 14272 KB Output isn't correct
23 Execution timed out 1000 ms 14272 KB Execution timed out
24 Incorrect 386 ms 14272 KB Output isn't correct
25 Execution timed out 1000 ms 14272 KB Execution timed out
26 Execution timed out 1000 ms 14272 KB Execution timed out
27 Execution timed out 1000 ms 14272 KB Execution timed out
28 Execution timed out 1000 ms 14272 KB Execution timed out
29 Execution timed out 1000 ms 14272 KB Execution timed out
30 Execution timed out 1000 ms 14272 KB Execution timed out
31 Execution timed out 1000 ms 14272 KB Execution timed out
32 Execution timed out 1000 ms 14272 KB Execution timed out
33 Execution timed out 1000 ms 14272 KB Execution timed out
34 Execution timed out 1000 ms 14272 KB Execution timed out
35 Execution timed out 1000 ms 14272 KB Execution timed out
36 Execution timed out 1000 ms 14272 KB Execution timed out
37 Incorrect 6 ms 14272 KB Output isn't correct
38 Execution timed out 1000 ms 14272 KB Execution timed out
39 Incorrect 9 ms 14272 KB Output isn't correct
40 Execution timed out 1000 ms 14272 KB Execution timed out
41 Incorrect 6 ms 14272 KB Output isn't correct
42 Execution timed out 1000 ms 14272 KB Execution timed out
43 Execution timed out 1000 ms 14272 KB Execution timed out
44 Execution timed out 1000 ms 14272 KB Execution timed out
45 Execution timed out 1000 ms 14272 KB Execution timed out
46 Execution timed out 1000 ms 14272 KB Execution timed out
47 Execution timed out 1000 ms 14272 KB Execution timed out
48 Execution timed out 1000 ms 14272 KB Execution timed out
49 Execution timed out 1000 ms 14272 KB Execution timed out
50 Execution timed out 1000 ms 14272 KB Execution timed out
51 Execution timed out 1000 ms 14272 KB Execution timed out
52 Execution timed out 1000 ms 14272 KB Execution timed out
53 Execution timed out 1000 ms 14272 KB Execution timed out
54 Execution timed out 1000 ms 14272 KB Execution timed out
55 Execution timed out 1000 ms 14272 KB Execution timed out
56 Execution timed out 1000 ms 14272 KB Execution timed out
57 Execution timed out 1000 ms 14272 KB Execution timed out
58 Execution timed out 1000 ms 14272 KB Execution timed out
59 Execution timed out 1000 ms 14272 KB Execution timed out
60 Execution timed out 1000 ms 14272 KB Execution timed out
61 Execution timed out 1000 ms 14272 KB Execution timed out
62 Execution timed out 1000 ms 14272 KB Execution timed out
63 Execution timed out 1000 ms 14272 KB Execution timed out
64 Execution timed out 1000 ms 14272 KB Execution timed out
65 Execution timed out 1000 ms 14272 KB Execution timed out
66 Execution timed out 1000 ms 14272 KB Execution timed out
67 Execution timed out 1000 ms 14272 KB Execution timed out
68 Execution timed out 1000 ms 14272 KB Execution timed out
69 Execution timed out 1000 ms 14272 KB Execution timed out
70 Execution timed out 1000 ms 14272 KB Execution timed out
71 Execution timed out 1000 ms 14272 KB Execution timed out
72 Execution timed out 1000 ms 14272 KB Execution timed out
73 Execution timed out 1000 ms 14272 KB Execution timed out
74 Execution timed out 1000 ms 14272 KB Execution timed out
75 Execution timed out 1000 ms 14272 KB Execution timed out
76 Execution timed out 1000 ms 14272 KB Execution timed out
77 Execution timed out 1000 ms 14272 KB Execution timed out
78 Execution timed out 1000 ms 14272 KB Execution timed out
79 Execution timed out 1000 ms 14272 KB Execution timed out
80 Execution timed out 1000 ms 14272 KB Execution timed out
81 Execution timed out 1000 ms 14272 KB Execution timed out
82 Execution timed out 1000 ms 14272 KB Execution timed out
83 Execution timed out 1000 ms 14272 KB Execution timed out
84 Execution timed out 1000 ms 14272 KB Execution timed out
85 Execution timed out 1000 ms 14272 KB Execution timed out
86 Execution timed out 1000 ms 14272 KB Execution timed out
87 Execution timed out 1000 ms 14272 KB Execution timed out
88 Execution timed out 1000 ms 14272 KB Execution timed out
89 Execution timed out 1000 ms 14272 KB Execution timed out
90 Execution timed out 1000 ms 14272 KB Execution timed out
91 Execution timed out 1000 ms 14272 KB Execution timed out
92 Execution timed out 1000 ms 14272 KB Execution timed out
93 Execution timed out 1000 ms 14272 KB Execution timed out
94 Execution timed out 1000 ms 14272 KB Execution timed out
95 Execution timed out 1000 ms 14272 KB Execution timed out
96 Execution timed out 1000 ms 14272 KB Execution timed out
97 Execution timed out 1000 ms 14272 KB Execution timed out
98 Execution timed out 1000 ms 14272 KB Execution timed out
99 Execution timed out 1000 ms 14272 KB Execution timed out
100 Execution timed out 1000 ms 14272 KB Execution timed out