HRBUST 1786最大駐車場(01マトリックスは最大の長方形を探します)

1437 ワード

タイトル:http://acm.hrbust.edu.cn/index.php?m=ProblemSet&a=showProblem&problem_id=1786
コード:
#include
#include
#include

using namespace std;

char maps[1005][1005];
int book[1005][1005];

int solve(int wist[], int n)
{
    //int hist[6]={3,2,2,0,0};
    int* arr = new int[n];//          
    arr[0] = hist[0];
    int max = hist[0]; //     

    for(int i=1; i=0; j--)
        {
            if(arr[j]>arr[i])
            {
                if(arr[j]*(i-j)>max)
                {
                    max = arr[j]*(i-j);
                }
                arr[j] = arr[i];
            }
            else break;
            //  arr    ,        。
            printf("%d ",arr[j]);
        }
    }

    /*for(int i=0;imax)
        {
            max = arr[i]*(n-i);
        }
    }
    //printf("%d 
",max); return max; } int main() { //freopen("B.in.txt","r",stdin); //freopen("B.out.txt","w",stdout); int t; scanf("%d",&t); while(t--) { memset(book,0,sizeof(book)); int n,m; scanf("%d%d",&n,&m); for(int i=0; i
テンプレートの問題にしましょう。