# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
333954 | beksultan04 | Bomb (IZhO17_bomb) | C++14 | 513 ms | 49516 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.
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int,int>
#define OK puts("OK");
#define fr first
#define sc second
#define ret return
#define scan1(a) scanf("%lld",&a);
#define scan2(a,b) scanf("%lld %lld",&a, &b);
#define scan3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c);
#define all(s) s.begin(),s.end()
#define pb push_back
#define endi puts("");
const int N = 1e6+12,INF=1e9+7;
int q[2501][2501],v[2501][2501],p[2501][2501],gor[N],ver[N];
main(){
int m,i,j,k,c=0,n,x=INF,y=INF;
scan2(n,m)
for (i=1;i<=n;++i)
for (j=1;j<=m;++j){
char ch;
cin>>ch;
q[i][j]=ch-'0';
}
for (i=1;i<=n;++i){
for (j=1;j<=m;++j){
if (q[i][j]){
c++;
}
else if (c!=0){
x = min(c,x);
c=0;
}
}
}
if (c!= 0)
x = min(c,x);
c=0;
for (i=1;i<=m;++i){
for (j=1;j<=n;++j){
if (q[j][i]){
c++;
}
else if (c!=0){
y = min(c,y);
c=0;
}
}
}
cout <<y*x<<" ";
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |