• <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>
            posts - 74,  comments - 33,  trackbacks - 0

            for (k = 1 ;k < n;k ++ )
            ????????????
            for (i = 1 ;i <= n - k;i ++ )
            ????????????????
            for (j = i;j < i + k;j ++ ) {
            ????????????????????Mdp[i][i
            + k] = getmax(Mdp[i][i + k],Sum(Mdp[i][j],flag[j],Mdp[j + 1 ][i + k]));
            ????????????????????Mdp[i][i
            + k] = getmax(Mdp[i][i + k],Sum(mdp[i][j],flag[j],mdp[j + 1 ][i + k]));
            ????????????????????mdp[i][i
            + k] = getmin(mdp[i][i + k],Sum(Mdp[i][j],flag[j],Mdp[j + 1 ][i + k]));
            ????????????????????mdp[i][i
            + k] = getmin(mdp[i][i + k],Sum(mdp[i][j],flag[j],mdp[j + 1 ][i + k]));
            ????????????????}

            ????????????????
            5019 Max

            TimeLimit : 1 Second ? Memorylimit : 32 Megabyte ?

            Totalsubmit : 114 ? Accepted : 28

            Give you a expression,you can add some parenthesis to maximize result.Example as following:
            1 + 2 * 3
            Its result is 7 in the example.But you can add a parenthesis like (1 + 2) * 3,then the result is 9,and so it is the maximization of the example.You job is to find the maximizaton of a expression. To simplify this problem,you can assume that expression contains only operator + and *,but note that integers may be negative.

            Input

            Input contains multiple test cases.Each case begin with a integer N(2<=N<=100), the number of integers of a expression.Then follows the expression.Integers and operator spearate with a single whitespace.

            Output

            For each case print a single line with the maximized value of the expression.

            Sample Input

            4
            1 + 2 * 3 + -1

            Sample Output

            8
            這題應該算是經典dp里面的題目。
            至于方法同棋盤分割,三角刨分,大體相同。
            主要是處理的時候要打兩張表,最大最小的表
            部分代碼如下
            posted on 2009-02-20 14:13 KNIGHT 閱讀(93) 評論(0)  編輯 收藏 引用
            <2008年12月>
            30123456
            78910111213
            14151617181920
            21222324252627
            28293031123
            45678910

            常用鏈接

            留言簿(8)

            隨筆檔案

            文章檔案

            Friends

            OJ

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            久久精品视屏| 99久久99这里只有免费费精品| 91精品国产9l久久久久| 久久99国产精品二区不卡| 久久九九亚洲精品| 色狠狠久久综合网| 精品久久人人爽天天玩人人妻| 97久久久精品综合88久久| 久久婷婷五月综合色99啪ak| 国产色综合久久无码有码| 久久久久久免费一区二区三区 | 久久久久亚洲av成人无码电影| 久久99九九国产免费看小说| 99久久精品毛片免费播放| 久久精品国产99久久久香蕉| 久久精品中文闷骚内射| 开心久久婷婷综合中文字幕| 久久国产一区二区| 婷婷久久久亚洲欧洲日产国码AV| 久久狠狠一本精品综合网| 久久久亚洲欧洲日产国码二区| 久久综合久久伊人| 国产精品午夜久久| 99久久精品国产一区二区三区| 狠狠色婷婷久久综合频道日韩| 国产精品青草久久久久福利99 | 亚洲国产精品18久久久久久| 欧美国产成人久久精品| 91久久精品电影| 久久综合丁香激情久久| 久久久久亚洲精品天堂| 囯产精品久久久久久久久蜜桃| 久久亚洲中文字幕精品一区| 久久国产视屏| 久久国产精品波多野结衣AV| 久久夜色tv网站| 久久综合狠狠色综合伊人| 亚洲国产成人久久综合一 | 久久精品一区二区国产| 成人免费网站久久久| 99久久99久久久精品齐齐|