Submission #386386

# Submission time Handle Problem Language Result Execution time Memory
386386 2021-04-06T13:36:13 Z vanic Bomb (IZhO17_bomb) C++14
16 / 100
1000 ms 640 KB
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <set>
#include <stack>
#include <vector>
#include <queue>
#include <map>
#include <cstring>
#include <array>
#include <bitset>
#include <cassert>

using namespace std;

const int maxn=105;

bitset < maxn > a[maxn];
bitset < maxn > b[maxn];
int n, m;

bool provjeri(int x, int y){
	for(int i=0; i<n; i++){
		for(int j=0; j<m; j++){
			b[i][j]=a[i][j];
		}
	}
	bool ne;
	for(int i=0; i<n; i++){
		for(int j=0; j<m; j++){
			if(a[i][j]){
				ne=0;
				for(int k=i; k<i+x; k++){
					for(int l=j; l<j+y; l++){
						if(k>=n || l>=m || !a[k][l]){
							ne=1;
							continue;
						}
					}
				}
				if(!ne){
					for(int k=i; k<i+x; k++){
						for(int l=j; l<j+y; l++){
							b[k][l]=0;
						}
					}
				}
			}
		}
	}
	for(int i=0; i<n; i++){
		for(int j=0; j<m; j++){
			if(b[i][j]){
				return 0;
			}
		}
	}
	return 1;

}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin >> n >> m;
	assert(n<maxn && m<maxn);
	string s;
	for(int i=0; i<n; i++){
		cin >> s;
		for(int j=0; j<m; j++){
			if(s[j]=='1'){
				a[i][j]=1;
			}
		}
	}
	int maksi=0;
	for(int i=1; i<=n; i++){
		for(int j=1; j<=m; j++){
			if(provjeri(i, j)){
				maksi=max(maksi, i*j);
			}
		}
	}
	cout << maksi << '\n';
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Runtime error 1 ms 492 KB Execution killed with signal 6
4 Runtime error 1 ms 492 KB Execution killed with signal 6
5 Runtime error 1 ms 620 KB Execution killed with signal 6
6 Runtime error 1 ms 492 KB Execution killed with signal 6
7 Correct 1 ms 364 KB Output is correct
8 Correct 6 ms 364 KB Output is correct
9 Correct 8 ms 364 KB Output is correct
10 Correct 2 ms 364 KB Output is correct
11 Correct 9 ms 364 KB Output is correct
12 Correct 4 ms 364 KB Output is correct
13 Correct 3 ms 364 KB Output is correct
14 Correct 6 ms 364 KB Output is correct
15 Correct 5 ms 364 KB Output is correct
16 Correct 29 ms 364 KB Output is correct
17 Execution timed out 1093 ms 364 KB Time limit exceeded
18 Execution timed out 1093 ms 364 KB Time limit exceeded
19 Execution timed out 1089 ms 364 KB Time limit exceeded
20 Execution timed out 1091 ms 364 KB Time limit exceeded
21 Correct 700 ms 492 KB Output is correct
22 Execution timed out 1093 ms 364 KB Time limit exceeded
23 Execution timed out 1047 ms 364 KB Time limit exceeded
24 Execution timed out 1081 ms 512 KB Time limit exceeded
25 Execution timed out 1080 ms 364 KB Time limit exceeded
26 Execution timed out 1049 ms 364 KB Time limit exceeded
27 Runtime error 2 ms 492 KB Execution killed with signal 6
28 Runtime error 2 ms 492 KB Execution killed with signal 6
29 Runtime error 2 ms 492 KB Execution killed with signal 6
30 Runtime error 1 ms 492 KB Execution killed with signal 6
31 Runtime error 2 ms 492 KB Execution killed with signal 6
32 Runtime error 2 ms 492 KB Execution killed with signal 6
33 Runtime error 1 ms 492 KB Execution killed with signal 6
34 Runtime error 1 ms 492 KB Execution killed with signal 6
35 Runtime error 2 ms 492 KB Execution killed with signal 6
36 Runtime error 2 ms 492 KB Execution killed with signal 6
37 Correct 16 ms 364 KB Output is correct
38 Runtime error 2 ms 492 KB Execution killed with signal 6
39 Correct 17 ms 364 KB Output is correct
40 Runtime error 1 ms 492 KB Execution killed with signal 6
41 Correct 18 ms 364 KB Output is correct
42 Execution timed out 1089 ms 364 KB Time limit exceeded
43 Runtime error 2 ms 492 KB Execution killed with signal 6
44 Runtime error 1 ms 492 KB Execution killed with signal 6
45 Runtime error 2 ms 492 KB Execution killed with signal 6
46 Runtime error 2 ms 492 KB Execution killed with signal 6
47 Runtime error 1 ms 492 KB Execution killed with signal 6
48 Runtime error 2 ms 492 KB Execution killed with signal 6
49 Runtime error 1 ms 492 KB Execution killed with signal 6
50 Runtime error 2 ms 492 KB Execution killed with signal 6
51 Runtime error 1 ms 492 KB Execution killed with signal 6
52 Runtime error 1 ms 492 KB Execution killed with signal 6
53 Runtime error 1 ms 492 KB Execution killed with signal 6
54 Runtime error 2 ms 492 KB Execution killed with signal 6
55 Runtime error 2 ms 492 KB Execution killed with signal 6
56 Runtime error 2 ms 492 KB Execution killed with signal 6
57 Runtime error 1 ms 492 KB Execution killed with signal 6
58 Runtime error 1 ms 492 KB Execution killed with signal 6
59 Runtime error 2 ms 636 KB Execution killed with signal 6
60 Runtime error 2 ms 492 KB Execution killed with signal 6
61 Runtime error 2 ms 492 KB Execution killed with signal 6
62 Runtime error 2 ms 492 KB Execution killed with signal 6
63 Runtime error 1 ms 492 KB Execution killed with signal 6
64 Runtime error 2 ms 492 KB Execution killed with signal 6
65 Runtime error 1 ms 492 KB Execution killed with signal 6
66 Runtime error 1 ms 492 KB Execution killed with signal 6
67 Runtime error 2 ms 620 KB Execution killed with signal 6
68 Runtime error 1 ms 492 KB Execution killed with signal 6
69 Runtime error 1 ms 492 KB Execution killed with signal 6
70 Runtime error 1 ms 492 KB Execution killed with signal 6
71 Runtime error 1 ms 492 KB Execution killed with signal 6
72 Runtime error 1 ms 492 KB Execution killed with signal 6
73 Runtime error 1 ms 492 KB Execution killed with signal 6
74 Runtime error 1 ms 492 KB Execution killed with signal 6
75 Runtime error 2 ms 492 KB Execution killed with signal 6
76 Runtime error 1 ms 492 KB Execution killed with signal 6
77 Runtime error 2 ms 492 KB Execution killed with signal 6
78 Runtime error 1 ms 492 KB Execution killed with signal 6
79 Runtime error 2 ms 492 KB Execution killed with signal 6
80 Runtime error 2 ms 492 KB Execution killed with signal 6
81 Runtime error 2 ms 492 KB Execution killed with signal 6
82 Runtime error 2 ms 492 KB Execution killed with signal 6
83 Runtime error 1 ms 492 KB Execution killed with signal 6
84 Runtime error 1 ms 492 KB Execution killed with signal 6
85 Runtime error 2 ms 492 KB Execution killed with signal 6
86 Runtime error 2 ms 492 KB Execution killed with signal 6
87 Runtime error 2 ms 492 KB Execution killed with signal 6
88 Runtime error 2 ms 492 KB Execution killed with signal 6
89 Runtime error 1 ms 492 KB Execution killed with signal 6
90 Runtime error 2 ms 492 KB Execution killed with signal 6
91 Runtime error 2 ms 492 KB Execution killed with signal 6
92 Runtime error 2 ms 640 KB Execution killed with signal 6
93 Runtime error 1 ms 492 KB Execution killed with signal 6
94 Runtime error 2 ms 492 KB Execution killed with signal 6
95 Runtime error 1 ms 492 KB Execution killed with signal 6
96 Runtime error 1 ms 492 KB Execution killed with signal 6
97 Runtime error 2 ms 492 KB Execution killed with signal 6
98 Runtime error 2 ms 492 KB Execution killed with signal 6
99 Runtime error 2 ms 492 KB Execution killed with signal 6
100 Runtime error 2 ms 492 KB Execution killed with signal 6