답안 #386445

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
386445 2021-04-06T14:58:51 Z vanic Bomb (IZhO17_bomb) C++14
6 / 100
2 ms 768 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=20;

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;
							break;
						}
						if(ne){
							break;
						}
					}
				}
				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;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 492 KB Execution killed with signal 6
2 Runtime error 1 ms 492 KB Execution killed with signal 6
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 492 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 Runtime error 1 ms 492 KB Execution killed with signal 6
9 Runtime error 2 ms 492 KB Execution killed with signal 6
10 Correct 1 ms 364 KB Output is correct
11 Runtime error 1 ms 492 KB Execution killed with signal 6
12 Correct 1 ms 364 KB Output is correct
13 Correct 1 ms 364 KB Output is correct
14 Correct 2 ms 512 KB Output is correct
15 Correct 2 ms 364 KB Output is correct
16 Runtime error 1 ms 492 KB Execution killed with signal 6
17 Runtime error 2 ms 492 KB Execution killed with signal 6
18 Runtime error 1 ms 492 KB Execution killed with signal 6
19 Runtime error 2 ms 492 KB Execution killed with signal 6
20 Runtime error 1 ms 492 KB Execution killed with signal 6
21 Runtime error 1 ms 492 KB Execution killed with signal 6
22 Runtime error 1 ms 492 KB Execution killed with signal 6
23 Runtime error 2 ms 492 KB Execution killed with signal 6
24 Runtime error 1 ms 492 KB Execution killed with signal 6
25 Runtime error 1 ms 492 KB Execution killed with signal 6
26 Runtime error 2 ms 492 KB Execution killed with signal 6
27 Runtime error 1 ms 492 KB Execution killed with signal 6
28 Runtime error 1 ms 492 KB Execution killed with signal 6
29 Runtime error 2 ms 492 KB Execution killed with signal 6
30 Runtime error 2 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 768 KB Execution killed with signal 6
33 Runtime error 2 ms 364 KB Execution killed with signal 6
34 Runtime error 2 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 Runtime error 2 ms 492 KB Execution killed with signal 6
38 Runtime error 2 ms 492 KB Execution killed with signal 6
39 Runtime error 2 ms 492 KB Execution killed with signal 6
40 Runtime error 1 ms 492 KB Execution killed with signal 6
41 Runtime error 1 ms 492 KB Execution killed with signal 6
42 Runtime error 1 ms 640 KB Execution killed with signal 6
43 Runtime error 1 ms 492 KB Execution killed with signal 6
44 Runtime error 1 ms 492 KB Execution killed with signal 6
45 Runtime error 1 ms 492 KB Execution killed with signal 6
46 Runtime error 2 ms 492 KB Execution killed with signal 6
47 Runtime error 2 ms 492 KB Execution killed with signal 6
48 Runtime error 1 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 2 ms 492 KB Execution killed with signal 6
52 Runtime error 2 ms 492 KB Execution killed with signal 6
53 Runtime error 2 ms 492 KB Execution killed with signal 6
54 Runtime error 1 ms 492 KB Execution killed with signal 6
55 Runtime error 1 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 2 ms 492 KB Execution killed with signal 6
59 Runtime error 1 ms 492 KB Execution killed with signal 6
60 Runtime error 1 ms 492 KB Execution killed with signal 6
61 Runtime error 1 ms 492 KB Execution killed with signal 6
62 Runtime error 1 ms 492 KB Execution killed with signal 6
63 Runtime error 2 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 1 ms 492 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 2 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 1 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 1 ms 492 KB Execution killed with signal 6
81 Runtime error 1 ms 492 KB Execution killed with signal 6
82 Runtime error 2 ms 492 KB Execution killed with signal 6
83 Runtime error 2 ms 492 KB Execution killed with signal 6
84 Runtime error 1 ms 492 KB Execution killed with signal 6
85 Runtime error 1 ms 492 KB Execution killed with signal 6
86 Runtime error 1 ms 492 KB Execution killed with signal 6
87 Runtime error 1 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 492 KB Execution killed with signal 6
93 Runtime error 2 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 2 ms 492 KB Execution killed with signal 6
97 Runtime error 1 ms 492 KB Execution killed with signal 6
98 Runtime error 2 ms 640 KB Execution killed with signal 6
99 Runtime error 2 ms 748 KB Execution killed with signal 6
100 Runtime error 1 ms 492 KB Execution killed with signal 6