# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
915533 |
2024-01-24T06:30:53 Z |
vjudge1 |
Bomb (IZhO17_bomb) |
C++17 |
|
0 ms |
0 KB |
/*#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx,avx2,fma")*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll n,m,k,cnt;
void anomalous_solve()
{
cin>>n>>m;
char a[n+1][m+1];
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
{
cin>>a[i][j];
}
}
ll mx1=1e9,mx2=1e9;
cnt=0;
for(int i=1;i<=n;i++)
{
cnt=0;s
for(int j=1;j<=m;j++)
{
if(a[i][j]=='1')cnt++;
else if(cnt>0)
{
mx2=min(mx2,cnt);
cnt=0;
}
}
if(cnt>0)
{
mx2=min(mx2,cnt);
}
}
for(int j=1;j<=m;j++)
{
cnt=0;
for(int i=1;i<=n;i++)
{
if(a[i][j]=='1')cnt++;
else if(cnt>0)
{
mx1=min(mx1,cnt);
cnt=0;
}
}
if(cnt>0)
{
mx1=min(mx1,cnt);
}
}
//cout<<mx1<<" "<<mx2<<"\n";
ll ans=0;
if(mx1==0 && mx2==0)
{
cout<<0;return;
}
for(ll i=1;i<=mx1;i++)
{
for(ll j=1;j<=mx2;j++)
{
ans=max(ans,i*j);
}
}
cout<<ans<<" ";
}
int main()
{
//freopen("INPUT.txt","r",stdin);
//freopen("OUTPUT.txt","w",stdout);
ios_base::sync_with_stdio();
cin.tie(NULL);
cout.tie(NULL);
ll test=1;
//cin>>test;
for(int pos=1;pos<=test;pos++)
anomalous_solve();
}
Compilation message
bomb.cpp: In function 'void anomalous_solve()':
bomb.cpp:23:9: error: 's' was not declared in this scope
23 | cnt=0;s
| ^
bomb.cpp:24:15: error: 'j' was not declared in this scope
24 | for(int j=1;j<=m;j++)
| ^