# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
833271 | vjudge1 | Bomb (IZhO17_bomb) | C++17 | 46 ms | 7124 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define endl '\n';
#define el cout<<endl
#define fr(i,n,m) for(int i=n;i<=m;i++)
#define frr(i,n,m) for(int i=n;i>=m;i--)
#define vi vector<int>
#define pi pair<int,int>
#define vpi vector<pi>
#define inf 1e18
int n,m,k,l,r,num=0,ans=0,sum=0,mi=inf,ma=0;
int a,b,c,d,e,x,y,z,w,q;
const int N = 2500 + 5;
// vpi adj[N];
string v[N];
void solve(){
cin >> n >> m;
fr(i,1,n){
cin>>v[i];
}
mi=inf;
fr(i,1,n){
a = 0;
fr(j,1,m){
if(v[i][j] == '1'){
a++;
}
else{
if(a){
mi = min(mi, a); a = 0;
}
}
}
}
if(a) mi = min(mi, a);
ma = inf;
fr(j,1,m){
a = 0;
fr(i,1,n){
if(v[i][j] == '1'){
a++;
}
else{
if(a){
ma = min(ma, a); a = 0;
}
}
}
}
if(a) ma = min(ma, a); a = 0;
cout << mi*ma;
}
signed main(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int T = 1;
// cin >> T;
while(T--){
cout<<fixed<<setprecision(12);solve();
el;
}return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |