|
|
|
|
讨论 Discussion |
|
|
我也是醉了 |
#include<bits/stdc++.h>
using namespace std;
long long p,t,n,k,x=0 ;
int i,j;
int maxs=0;
bool f;
int a[100000][3]={0};
void zuida(int s){
if(s>maxs)maxs=s;
}
int main(){
freopen("p1583.in","r",stdin);
freopen("p1583.out","w",stdout);
scanf("%d",&n);
j =0; maxs =0;
for (i=1;i<=n;i++){
scanf("%d",&k);
if(i==1){
x++;
a[x][1] =k;
a[x][2] =1;
zuida(a[x][1]*a[x][2]);
continue;
}
f=true;
t=1;
for(j=x;j>=1;j--)
if(a[j][1]<k){
a[j][2]=a[j][2]+1;
zuida(a[j][1]*a[j][2]);
}
else
{
p=j;if(a[j][2]+1>t)
t=a[j][2]+1;
f=false;
};
if(f){
x=x+1;
a[x][1]=k;
a[x][2]=1;
}
else
{
x=p;
a[x][1]=k;
a[x][2]=t;
}
zuida(k*t);
}
printf("%d",maxs);
fclose(stdin);
fclose(stdout);
return 0;
}//只能拿90分
( ) |
|
|
|
|
|
|
|
|
|
Flag |
|
题号 |
P1583 |
|
其它 |
通过 |
3人 |
提交 |
100次 |
通过率 |
3% |
难度 |
2 |
|
|
|
|
|
|