# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
334311 | juggernaut | Bomb (IZhO17_bomb) | C++14 | 721 ms | 55648 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;
template<class T>void umin(T& a,T b){if(b<a)a=b;}
template<class T>void umax(T& a,T b){if(b>a)a=b;}
int n,m,xx,yy,up[2505][2505],down[2505][2505],ans[2505];
bool ar[2505][2505];
char rd(){
char ch;
do{
scanf("%c",&ch);
}while(ch!='0'&&ch!='1');
return ch;
}
int main(){
scanf("%d%d",&n,&m);
xx=n,yy=m;
for(int i=1;i<=n;i++){
int cnt=0;
for(int j=1;j<=m;j++){
ar[i][j]=(rd()=='1');
if(ar[i][j])cnt++;
else{
if(cnt)umin(yy,cnt);
cnt=0;
}
}
if(cnt)umin(yy,cnt);
}
for(int j=1;j<=m;j++){
int cnt=0;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |