Submission #1102910

# Submission time Handle Problem Language Result Execution time Memory
1102910 2024-10-19T08:40:43 Z Muhammet Bomb (IZhO17_bomb) C++17
14 / 100
1000 ms 25424 KB
#include <bits/stdc++.h>

using namespace std;

const int N = 2505;

int n, m;

char c[N][N], c1[N][N];

bool f(int a, int b){
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= m; j++){
            c1[i][j] = c[i][j];
        }
    }
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= m; j++){
            bool tr = 0;
            for(int i1 = i; i1 <= i+a-1; i1++){
                for(int j1 = j; j1 <= j+b-1; j1++){
                    if(c[i1][j1] == '0'){
                        tr = 1;
                        break;
                    }
                }
            }
            if(tr == 0){
                for(int i1 = i; i1 <= i+a-1; i1++){
                    for(int j1 = j; j1 <= j+b-1; j1++){
                        c1[i1][j1] = '0';
                    }
                }
            }
        }
    }
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= m; j++){
            if(c1[i][j] == '1') return false;
        }
    }
    return true;
}

int main(){
    cin >> n >> m;
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= m; j++){
            cin >> c[i][j];
        }
    }
    int ans = 0;
    for(int a = 1; a <= n; a++){
        for(int b = 1; b <= m; b++){
            if(f(a,b) == true) ans = max(a*b, ans);
        }
    }
    cout << ans;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2384 KB Output is correct
2 Correct 1 ms 2384 KB Output is correct
3 Runtime error 31 ms 25208 KB Execution killed with signal 11
4 Runtime error 21 ms 25424 KB Execution killed with signal 11
5 Correct 604 ms 2488 KB Output is correct
6 Incorrect 96 ms 2484 KB Output isn't correct
7 Correct 1 ms 2384 KB Output is correct
8 Correct 6 ms 2384 KB Output is correct
9 Correct 7 ms 2544 KB Output is correct
10 Correct 2 ms 2384 KB Output is correct
11 Correct 7 ms 2384 KB Output is correct
12 Correct 2 ms 2384 KB Output is correct
13 Incorrect 2 ms 2384 KB Output isn't correct
14 Correct 4 ms 2384 KB Output is correct
15 Correct 7 ms 2384 KB Output is correct
16 Incorrect 24 ms 2384 KB Output isn't correct
17 Execution timed out 1056 ms 2640 KB Time limit exceeded
18 Execution timed out 1069 ms 2640 KB Time limit exceeded
19 Execution timed out 1063 ms 6736 KB Time limit exceeded
20 Execution timed out 1073 ms 6736 KB Time limit exceeded
21 Execution timed out 1057 ms 2608 KB Time limit exceeded
22 Execution timed out 1044 ms 4688 KB Time limit exceeded
23 Execution timed out 1066 ms 6736 KB Time limit exceeded
24 Execution timed out 1064 ms 4688 KB Time limit exceeded
25 Execution timed out 1069 ms 6736 KB Time limit exceeded
26 Execution timed out 1057 ms 6736 KB Time limit exceeded
27 Execution timed out 1070 ms 6736 KB Time limit exceeded
28 Execution timed out 1076 ms 6736 KB Time limit exceeded
29 Execution timed out 1048 ms 6736 KB Time limit exceeded
30 Execution timed out 1062 ms 6736 KB Time limit exceeded
31 Execution timed out 1076 ms 6736 KB Time limit exceeded
32 Execution timed out 1047 ms 6736 KB Time limit exceeded
33 Execution timed out 1066 ms 6736 KB Time limit exceeded
34 Execution timed out 1065 ms 6736 KB Time limit exceeded
35 Execution timed out 1056 ms 6736 KB Time limit exceeded
36 Execution timed out 1051 ms 6736 KB Time limit exceeded
37 Correct 10 ms 2384 KB Output is correct
38 Execution timed out 1065 ms 12616 KB Time limit exceeded
39 Correct 11 ms 2384 KB Output is correct
40 Execution timed out 1095 ms 6592 KB Time limit exceeded
41 Correct 11 ms 2384 KB Output is correct
42 Execution timed out 1097 ms 6736 KB Time limit exceeded
43 Execution timed out 1049 ms 12612 KB Time limit exceeded
44 Execution timed out 1069 ms 6736 KB Time limit exceeded
45 Execution timed out 1041 ms 12476 KB Time limit exceeded
46 Execution timed out 1067 ms 12616 KB Time limit exceeded
47 Execution timed out 1049 ms 12480 KB Time limit exceeded
48 Execution timed out 1078 ms 12616 KB Time limit exceeded
49 Execution timed out 1048 ms 12616 KB Time limit exceeded
50 Execution timed out 1042 ms 12616 KB Time limit exceeded
51 Execution timed out 1064 ms 12472 KB Time limit exceeded
52 Execution timed out 1060 ms 12476 KB Time limit exceeded
53 Execution timed out 1067 ms 12472 KB Time limit exceeded
54 Execution timed out 1061 ms 12472 KB Time limit exceeded
55 Execution timed out 1058 ms 12616 KB Time limit exceeded
56 Execution timed out 1063 ms 12616 KB Time limit exceeded
57 Execution timed out 1049 ms 12616 KB Time limit exceeded
58 Execution timed out 1062 ms 12628 KB Time limit exceeded
59 Execution timed out 1052 ms 12616 KB Time limit exceeded
60 Execution timed out 1050 ms 12616 KB Time limit exceeded
61 Execution timed out 1079 ms 12616 KB Time limit exceeded
62 Execution timed out 1060 ms 12472 KB Time limit exceeded
63 Execution timed out 1062 ms 12616 KB Time limit exceeded
64 Execution timed out 1055 ms 12616 KB Time limit exceeded
65 Execution timed out 1054 ms 12464 KB Time limit exceeded
66 Execution timed out 1060 ms 12616 KB Time limit exceeded
67 Execution timed out 1062 ms 12620 KB Time limit exceeded
68 Execution timed out 1073 ms 12504 KB Time limit exceeded
69 Execution timed out 1083 ms 12616 KB Time limit exceeded
70 Execution timed out 1061 ms 11336 KB Time limit exceeded
71 Execution timed out 1065 ms 12616 KB Time limit exceeded
72 Execution timed out 1054 ms 12468 KB Time limit exceeded
73 Execution timed out 1068 ms 12480 KB Time limit exceeded
74 Execution timed out 1072 ms 12616 KB Time limit exceeded
75 Execution timed out 1057 ms 12472 KB Time limit exceeded
76 Execution timed out 1055 ms 12480 KB Time limit exceeded
77 Execution timed out 1045 ms 13068 KB Time limit exceeded
78 Execution timed out 1063 ms 12616 KB Time limit exceeded
79 Execution timed out 1065 ms 12616 KB Time limit exceeded
80 Execution timed out 1060 ms 12476 KB Time limit exceeded
81 Execution timed out 1053 ms 12472 KB Time limit exceeded
82 Execution timed out 1070 ms 12616 KB Time limit exceeded
83 Execution timed out 1072 ms 12476 KB Time limit exceeded
84 Execution timed out 1070 ms 12472 KB Time limit exceeded
85 Execution timed out 1060 ms 12616 KB Time limit exceeded
86 Execution timed out 1070 ms 12616 KB Time limit exceeded
87 Execution timed out 1060 ms 12476 KB Time limit exceeded
88 Execution timed out 1067 ms 12584 KB Time limit exceeded
89 Execution timed out 1050 ms 12624 KB Time limit exceeded
90 Execution timed out 1063 ms 11452 KB Time limit exceeded
91 Execution timed out 1069 ms 12616 KB Time limit exceeded
92 Execution timed out 1072 ms 12468 KB Time limit exceeded
93 Execution timed out 1062 ms 12476 KB Time limit exceeded
94 Execution timed out 1071 ms 14408 KB Time limit exceeded
95 Execution timed out 1078 ms 12616 KB Time limit exceeded
96 Execution timed out 1057 ms 12620 KB Time limit exceeded
97 Execution timed out 1048 ms 12476 KB Time limit exceeded
98 Execution timed out 1077 ms 12616 KB Time limit exceeded
99 Execution timed out 1074 ms 12472 KB Time limit exceeded
100 Execution timed out 1061 ms 12648 KB Time limit exceeded