# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1118808 | Younis_Dwai | Bomb (IZhO17_bomb) | C++14 | 131 ms | 12636 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include <bits/stdc++.h>
#define endl "\n"
#define F first
#define S second
#define pb push_back
#define int long long
#define in insert
#define mid (l+r)/2
#define in insert
using namespace std;
const int N=2505;
char b[N][N];
int n,m;
int32_t main(){
ios::sync_with_stdio(false);cin.tie(nullptr);
cin>>n>>m;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
cin>>b[i][j];
}
}
int h=n,w=m;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
if(b[i][j]=='1'){
int cnt=1;
while(j+1<=m && b[i][j+1]=='1'){
++cnt;
++j;
}
w=min(w,cnt);
}
}
}
for(int j=1;j<=m;j++){
for(int i=1;i<=n;i++){
if(b[i][j]=='1'){
int cnt=1;
while(i+1<=n && b[i+1][j]=='1'){
++i;
++cnt;
}
h=min(h,cnt);
}
}
}
cout<<h*w;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |