(I2
I123
I5
(dp0
Vmaxarrea.%l
p1
(V1.cpp
p2
S"#include <bits/stdc++.h>\r\n#define endl '\\n'\r\n\r\n#define int long long\r\n\r\nusing namespace std;\r\nconst int MAXN = (1 << 20);\r\n\r\nint n;\r\nint a[MAXN];\r\n\r\nvoid read()\r\n{\r\n    cin >> n;\r\n\r\n    for(int i = 1; i <= n; i++)\r\n        cin >> a[i];\r\n}\r\n\r\nint l[MAXN], r[MAXN];\r\n\r\nvoid solve()\r\n{\r\n    stack<int> st;\r\n\r\n    for(int i = 1; i <= n; i++)\r\n    {\r\n        while(!st.empty() && a[st.top()] >= a[i])\r\n            st.pop();\r\n\r\n        if(st.empty()) l[i] = 0;\r\n        else l[i] = st.top();\r\n\r\n        st.push(i);\r\n    }\r\n\r\n    while(!st.empty()) st.pop();\r\n\r\n    for(int i = n; i >= 1; i--)\r\n    {\r\n        while(!st.empty() && a[st.top()] >= a[i])\r\n            st.pop();\r\n\r\n        if(st.empty()) r[i] = n;\r\n        else r[i] = st.top();\r\n\r\n        st.push(i);\r\n    }\r\n\r\n    int ans = 0;\r\n    for(int i = 1; i <= n; i++)\r\n        ans = max(ans, (r[i] - l[i] - 1) * (a[i]));\r\n\r\n    cout << ans << endl;\r\n}\r\n\r\n#undef int\r\nint main()\r\n{\r\n    ios_base::sync_with_stdio(false);\r\n    cin.tie(NULL);\r\n\r\n    read();\r\n    solve();\r\n    return 0;\r\n}\r\n\r\n/*\r\n11\r\n6 5 2 7 8 6 8 3 5 6 7\r\n*/\r\n"
p3
tp4
stp5
.