• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            gzwzm06

              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
              1 隨筆 :: 52 文章 :: 17 評論 :: 0 Trackbacks

             

             

              1#include <cstdio>
              2#include <cstring>
              3
              4const int MAXN = 4008 ;
              5const int SIZE = 2003 ;
              6
              7int left[SIZE], right[SIZE] ;
              8int height[SIZE] ;
              9
             10int GetMaxArea(const int& len)
             11{
             12    int i , j , temp , maxArea ;
             13    maxArea = 0 ;
             14
             15    height[0= height[len + 1= -1 ;
             16
             17
             18    for ( i = 1 ; i <= len ; ++i )
             19    {
             20        for ( j = i - 1 ; ; j = left[j] )
             21        {
             22            if ( height[j] < height[i] )
             23            {
             24                left[i] = j ;
             25                break ;
             26            }

             27        }

             28    }

             29
             30    for ( i = len ; i > 0 ; --i )
             31    {
             32        for ( j = i + 1 ; ; j = right[j] )
             33        {
             34            if ( height[j] < height[i] )
             35            {
             36                right[i] = j ;
             37                break ;
             38            }

             39        }

             40    }

             41
             42    for ( i = 1 ; i <= len ; ++i )
             43    {
             44        if ( height[i] !=  height[i - 1] )
             45        {
             46            temp = height[i] * (right[i] - left[i] - 1) ;
             47
             48            if ( temp > maxArea )
             49                maxArea = temp ;
             50        }

             51    }

             52
             53    return maxArea ;
             54
             55}

             56
             57int main()
             58{
             59//    freopen("1.txt", "r", stdin) ;
             60
             61    int row , col , i , j ;
             62    int ans , temp , num ;
             63    char strData[MAXN] ;
             64
             65    while ( scanf("%d %d"&row, &col) != EOF )
             66    {
             67        getchar() ;
             68        gets(strData) ;
             69        for ( j = 1 ; j <= col ; ++j )
             70        {
             71            height[j] = strData[(j - 1* 2- '0' ;
             72        }

             73
             74        ans = GetMaxArea(col) ;
             75
             76        for ( i = 1 ; i < row ; ++i )
             77        {
             78            gets(strData) ;
             79
             80            for ( j = 1 ; j <= col ; ++j )
             81            {
             82                num = strData[(j - 1* 2- '0' ;
             83                if ( 0 == num ) {
             84                    height[j] = 0 ;
             85                }

             86                else  if ( 1 == num ) {
             87                    height[j]++ ;
             88                }

             89            }

             90
             91            temp = GetMaxArea(col) ;
             92
             93            if ( temp > ans ) 
             94                ans = temp ;
             95        }

             96
             97        printf("%d\n", ans) ;
             98    }

             99    return 0 ;
            100}
            posted on 2009-03-06 11:10 閱讀(245) 評論(0)  編輯 收藏 引用 所屬分類: DP
            日韩av无码久久精品免费| 岛国搬运www久久| 久久性生大片免费观看性| 欧美午夜A∨大片久久| 久久久久久亚洲精品影院| 囯产精品久久久久久久久蜜桃| 精品国产青草久久久久福利| 国产成人精品久久一区二区三区| 久久免费香蕉视频| 久久香蕉超碰97国产精品| 久久播电影网| 久久精品国产亚洲AV久| 国产成人精品久久| 久久亚洲精精品中文字幕| 久久久午夜精品福利内容| 秋霞久久国产精品电影院| 精品无码久久久久国产动漫3d| 久久99热这里只有精品国产| 亚洲AV无码一区东京热久久| 久久成人精品| 国产AⅤ精品一区二区三区久久| 亚洲精品乱码久久久久66| 国产精品青草久久久久福利99| 亚洲av伊人久久综合密臀性色| 亚洲国产日韩欧美久久| 久久亚洲精品视频| 国产成人精品白浆久久69| 日韩精品久久久久久久电影蜜臀| 最新久久免费视频| 热久久视久久精品18| 久久AⅤ人妻少妇嫩草影院| 国内精品久久久久影院免费| 日韩精品久久无码中文字幕| 无码久久精品国产亚洲Av影片| 四虎影视久久久免费观看| 91精品日韩人妻无码久久不卡| 久久精品九九亚洲精品| 久久精品国产久精国产思思| 伊人久久综合精品无码AV专区| 国产精品久久久久久久app| 久久乐国产综合亚洲精品|