delete pics to save space

This commit is contained in:
2023-08-03 09:22:52 +08:00
commit de60cd6ed4
1334 changed files with 66221 additions and 0 deletions

35
7.2559.cpp Normal file
View File

@ -0,0 +1,35 @@
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long LL;
const int maxn=100005;
LL n,a[maxn],w[maxn],s[maxn],p,res;
int main()
{
#ifdef local
freopen("pro.in","r",stdin);
#endif
while(scanf("%d",&n),n!=0)
{
for(int i=1;i<=n;i++) scanf("%lld",&a[i]);
a[n+1]=p=res=0;
for(int i=1;i<=n+1;i++)
{
if(a[i]>s[p]) { s[++p]=a[i]; w[p]=1; }
else
{
LL wid=0;
while(s[p]>a[i])
{
wid+=w[p];
res=max(res,wid*s[p]);
p--;
}
s[++p]=a[i]; w[p]=wid+1;
}
}
printf("%lld\n",res);
}
return 0;
}