제출 #386375

#제출 시각아이디문제언어결과실행 시간메모리
386375vanicBomb (IZhO17_bomb)C++14
3 / 100
1083 ms640 KiB
#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 p; bool ne; for(int i=0; i<n; i++){ for(int j=0; j<m; j++){ if(a[i][j]){ p=0; 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(b[k][l]){ b[k][l]=0; p=1; } } } if(ne && p){ 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 timeMemoryGrader output
Fetching results...