(I2
I153
I5
(dp0
Vmaxarrea.%l
p1
(Vmain.cpp
p2
S'#include <cstdio>\r\n\r\nusing namespace std;\r\n\r\nint nr,n,H,h[1000007],i;\r\nlong long D, d[1000007],Max=0LL;\r\n\r\nint main()\r\n{\r\n  // freopen("max.in","r",stdin);\r\n  //  freopen("max.out","w",stdout);\r\n\r\n    scanf("%d",&n);nr=0;\r\n    for(i=1;i<=n;++i)\r\n    {\r\n        scanf("%d",&H);D=0LL;\r\n        while(nr && H<h[nr])\r\n        {\r\n             D+=d[nr];\r\n             if(Max<1LL*h[nr]*D) Max=1LL*h[nr]*D;\r\n             --nr;\r\n        }\r\n        if(nr && h[nr]==H)\r\n        {\r\n            ++d[nr];\r\n        }\r\n        else\r\n        {\r\n            d[++nr]=D+1LL;\r\n            h[nr]=H;\r\n        }\r\n    }\r\n    D=0LL;\r\n    while(nr)\r\n    {\r\n        D+=d[nr];\r\n        if(Max<1LL*h[nr]*D) Max=1LL*h[nr]*D;\r\n        --nr;\r\n    }\r\n    printf("%I64d\\n",Max);\r\n\r\n   return 0;\r\n}\r\n'
p3
tp4
stp5
.