# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
386375 | vanic | Bomb (IZhO17_bomb) | C++14 | 1083 ms | 640 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |