(I2
I103
I5
(dp0
Vmaxarrea.%l
p1
(Vmaxarea.cpp
p2
S'#include <bits/stdc++.h>\r\nusing namespace std;\r\n\r\nint n;\r\nvector<int> cubes;\r\nint answer=0;\r\n\r\nvoid read()\r\n{\r\n    cin>>n;\r\n    cubes.resize(n);\r\n    for(int i=0;i<n;i++)\r\n    {\r\n        cin>>cubes[i];\r\n        answer=max(answer, cubes[i]);\r\n    }\r\n}\r\n\r\nstruct progress\r\n{\r\n    int len, heigth;\r\n    int size(){return len*heigth;}\r\n\r\n    progress(int len, int heigth)\r\n    {\r\n        this->len=len;\r\n        this->heigth=heigth;\r\n    }\r\n\r\n    progress next(int heigth)\r\n    {\r\n        return progress(len+1, min(this->heigth, heigth));\r\n    }\r\n\r\n    bool operator < (const progress &that)const\r\n    {\r\n        if(heigth<that.heigth)return true;\r\n        else if(heigth==that.heigth)\r\n        {\r\n            return len>that.len;\r\n        }\r\n        else return false;\r\n    }\r\n};\r\n\r\nint main()\r\n{\r\n    ios::sync_with_stdio(false);\r\n    cin.tie(nullptr);\r\n    read();\r\n\r\n\r\n    //for(progress p : bfs)printf("%d %d\\n", p);\r\n    //puts("\\n\\n");\r\n\r\n    vector<progress> bfs;\r\n    for(int i=0;i<cubes.size();i++)\r\n    {\r\n        vector<progress> newBfs;\r\n        newBfs.emplace_back(1, cubes[i]);\r\n        for(int j=0;j<bfs.size();j++)\r\n        {\r\n            newBfs.push_back(bfs[j].next(cubes[i]));\r\n        }\r\n\r\n        bfs.clear();\r\n        sort(newBfs.begin(), newBfs.end());\r\n        for(int i=0;i<newBfs.size();i++)\r\n        {\r\n            if(i==0||newBfs[i].heigth!=newBfs[i-1].heigth)\r\n            {\r\n                bfs.push_back(newBfs[i]);\r\n                answer=max(answer, newBfs[i].size());\r\n            }\r\n        }\r\n\r\n        //for(progress p : bfs)printf("%d %d %d\\n", p, p.size());\r\n        //puts("\\n\\n");\r\n    }\r\n\r\n    printf("%d\\n", answer);\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
.