• <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)  編輯 收藏 引用
            <2009年2月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            1234567

            常用鏈接

            留言簿(8)

            隨筆檔案

            文章檔案

            Friends

            OJ

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            久久久精品午夜免费不卡| 久久99国产精品久久| 久久午夜无码鲁丝片午夜精品| 久久综合狠狠色综合伊人| 久久国产视频网| 久久精品无码一区二区WWW | 国产精品99久久99久久久| 国产成人精品综合久久久| 中文字幕无码久久精品青草| 韩国免费A级毛片久久| 久久精品无码一区二区三区日韩| 99久久国产精品免费一区二区 | 久久久免费观成人影院| 久久亚洲日韩精品一区二区三区| 国产综合精品久久亚洲| 久久久av波多野一区二区| 久久久精品波多野结衣| 99麻豆久久久国产精品免费 | 久久九九青青国产精品| 亚洲国产成人精品91久久久| 久久国产精品77777| 久久久这里只有精品加勒比| 久久国产乱子伦精品免费强| 亚洲乱码精品久久久久..| 欧美性大战久久久久久| 国产精品VIDEOSSEX久久发布 | 久久天天躁狠狠躁夜夜不卡| 国内精品久久久久久99| 久久狠狠高潮亚洲精品| 99久久无色码中文字幕人妻| 日韩欧美亚洲综合久久| 精品无码久久久久久国产| 日本免费一区二区久久人人澡 | 久久久亚洲AV波多野结衣 | 色综合久久久久无码专区| 亚洲精品久久久www| 久久精品亚洲福利| 久久久久一本毛久久久| 久久精品国产只有精品66| 青青草原综合久久大伊人导航| 久久无码精品一区二区三区|