(I2
I117
I5
(dp0
Vmaxarrea.%l
p1
(Vsmartarea.cpp
p2
S'#include <iostream>\r\n#include<algorithm>\r\n#define MAXD 16000\r\nusing namespace std;\r\nint main(){\r\n    int colCount, curr, i, j, a, b;\r\n    cin>>colCount;\r\n    vector<int> col;\r\n    for(i=0; i<colCount; i++){\r\n        cin>>curr;\r\n        col.push_back(curr);        \r\n    }\r\n    bool changed, wasLast;\r\n    int row = 0, current, currMax, ind;\r\n    unsigned long long maxArea = 0;\r\n    while(true){\r\n        currMax = 0;\r\n        changed = false;\r\n        wasLast = false;\r\n        for(i=0; i<colCount; i++){\r\n            if(col[i]-1<row){\r\n                if(wasLast){\r\n                    wasLast = false;\r\n                    if((i-ind)>currMax){\r\n                        currMax = (i-ind);\r\n                    }\r\n                }\r\n            }\r\n            else {\r\n                if(!wasLast)\r\n                    ind = i;\r\n                changed = true;\r\n                wasLast = true;\r\n            }\r\n        }\r\n        if(wasLast){\r\n                    wasLast = false;\r\n                    if((colCount-ind)>currMax){\r\n                        currMax = (i-ind);\r\n                    }\r\n                }\r\n        if(currMax*(row+1)>maxArea){\r\n            maxArea = currMax*(row+1);\r\n        }\r\n        if(!changed)\r\n            break;\r\n        row++;\r\n    }\r\n    cout<<maxArea<<endl;\r\n    return 0;\r\n}\r\n\r\n\r\n/*\r\n11\r\n6 5 2 7 8 6 8 3 5 6 7\r\n*/'
p3
tp4
stp5
.