답안 #386446

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

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 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 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 Correct 3 ms 364 KB Output is correct
9 Correct 3 ms 364 KB Output is correct
10 Correct 2 ms 364 KB Output is correct
11 Correct 4 ms 364 KB Output is correct
12 Correct 1 ms 364 KB Output is correct
13 Correct 1 ms 364 KB Output is correct
14 Correct 2 ms 364 KB Output is correct
15 Correct 3 ms 364 KB Output is correct
16 Correct 9 ms 364 KB Output is correct
17 Correct 720 ms 396 KB Output is correct
18 Correct 156 ms 492 KB Output is correct
19 Execution timed out 1070 ms 492 KB Time limit exceeded
20 Execution timed out 1090 ms 364 KB Time limit exceeded
21 Correct 129 ms 364 KB Output is correct
22 Correct 389 ms 492 KB Output is correct
23 Runtime error 2 ms 492 KB Execution killed with signal 6
24 Correct 840 ms 492 KB Output is correct
25 Runtime error 2 ms 492 KB Execution killed with signal 6
26 Runtime error 1 ms 492 KB Execution killed with signal 6
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 1 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 492 KB Execution killed with signal 6
33 Runtime error 2 ms 768 KB Execution killed with signal 6
34 Runtime error 1 ms 492 KB Execution killed with signal 6
35 Runtime error 1 ms 492 KB Execution killed with signal 6
36 Runtime error 2 ms 492 KB Execution killed with signal 6
37 Correct 5 ms 364 KB Output is correct
38 Runtime error 1 ms 492 KB Execution killed with signal 6
39 Correct 5 ms 364 KB Output is correct
40 Runtime error 2 ms 492 KB Execution killed with signal 6
41 Correct 6 ms 364 KB Output is correct
42 Runtime error 2 ms 492 KB Execution killed with signal 6
43 Runtime error 2 ms 492 KB Execution killed with signal 6
44 Runtime error 2 ms 492 KB Execution killed with signal 6
45 Runtime error 1 ms 492 KB Execution killed with signal 6
46 Runtime error 1 ms 492 KB Execution killed with signal 6
47 Runtime error 2 ms 492 KB Execution killed with signal 6
48 Runtime error 2 ms 492 KB Execution killed with signal 6
49 Runtime error 2 ms 492 KB Execution killed with signal 6
50 Runtime error 1 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 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 1 ms 492 KB Execution killed with signal 6
57 Runtime error 2 ms 492 KB Execution killed with signal 6
58 Runtime error 1 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 2 ms 492 KB Execution killed with signal 6
67 Runtime error 2 ms 640 KB Execution killed with signal 6
68 Runtime error 3 ms 492 KB Execution killed with signal 6
69 Runtime error 2 ms 492 KB Execution killed with signal 6
70 Runtime error 2 ms 492 KB Execution killed with signal 6
71 Runtime error 2 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 2 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 2 ms 492 KB Execution killed with signal 6
81 Runtime error 1 ms 492 KB Execution killed with signal 6
82 Runtime error 1 ms 492 KB Execution killed with signal 6
83 Runtime error 1 ms 492 KB Execution killed with signal 6
84 Runtime error 2 ms 492 KB Execution killed with signal 6
85 Runtime error 2 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 2 ms 492 KB Execution killed with signal 6
90 Runtime error 1 ms 492 KB Execution killed with signal 6
91 Runtime error 1 ms 492 KB Execution killed with signal 6
92 Runtime error 1 ms 492 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 2 ms 492 KB Execution killed with signal 6
96 Runtime error 2 ms 512 KB Execution killed with signal 6
97 Runtime error 1 ms 492 KB Execution killed with signal 6
98 Runtime error 1 ms 492 KB Execution killed with signal 6
99 Runtime error 1 ms 492 KB Execution killed with signal 6
100 Runtime error 1 ms 492 KB Execution killed with signal 6