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