• <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>

            公告

            聯系我:我的126郵箱: billhsu。 Locations of visitors to this page
            <2008年9月>
            31123456
            78910111213
            14151617181920
            21222324252627
            2829301234
            567891011

            統計

            • 隨筆 - 41
            • 文章 - 0
            • 評論 - 82
            • 引用 - 0

            常用鏈接

            留言簿(16)

            隨筆分類

            隨筆檔案

            相冊

            Game Dev

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            stredit problem
            s and t are two strings.
            Change string s into string t in the least steps.
            In each step you can insert or delete a char of the string.
            INPUT n1 s
            n2 t
            n1 is the length of string s
            n2 is the length of string t
            OUT the least steps
            exp:
            INPUT 4 abcd
            6 aefbhd
            OUT 4
            #include<iostream>
            #include
            <string>

            using namespace std;

            string s1,s2;
            int map[100];
            int i,j,result[100];
            int n1,n2,nc;

            int main(){
                cin
            >>n1>>s1>>n2>>s2;
                nc
            =0;
                
            for (i=0;i<n1;i++){
                    
            if ((j=s2.find(s1[i]))>=0){
                      map[nc]
            =j;
                      s2.replace(j,
            1," ");
                      nc
            ++;
                      }
                      }
                result[nc
            -1]=1;
                
            for (i=nc-2;i>=0;i--){
                    
            for (j=i+1;j<nc;j++if ((map[i]<map[j])&&(result[i]<result[j])) result[i]=result[j];
                    result[i]
            ++;
                    }
                j
            =0;
                
            for (i=0;i<nc;i++if(result[i]>j) j=result[i];
                cout
            <<n1+n2-j-j;
                system(
            "pause");
                
            return 0;
            }



            posted on 2008-08-01 13:41 Bill Hsu 閱讀(321) 評論(0)  編輯 收藏 引用 所屬分類: Algorithm

            国产高潮国产高潮久久久| 午夜肉伦伦影院久久精品免费看国产一区二区三区 | 久久强奷乱码老熟女| 亚洲国产成人久久综合一区77| 久久久亚洲裙底偷窥综合| 欧美大香线蕉线伊人久久| 国产福利电影一区二区三区久久老子无码午夜伦不 | 久久久久亚洲AV片无码下载蜜桃 | 99久久精品国内| 亚洲人成无码网站久久99热国产| 亚洲精品美女久久777777| 狠狠色伊人久久精品综合网| 亚洲乱码精品久久久久..| 久久久久久久亚洲精品| 国产69精品久久久久777| 久久夜色精品国产亚洲| 99久久精品免费看国产| 97久久超碰国产精品2021| 久久笫一福利免费导航| 久久精品女人天堂AV麻| 久久99精品国产一区二区三区| 亚洲AV日韩精品久久久久久久 | 亚洲va国产va天堂va久久| 精品久久久久久久久久中文字幕| 久久久国产乱子伦精品作者| 国产成人精品久久| 久久免费视频一区| 久久一区二区三区99| 91久久成人免费| 国内精品久久国产大陆| 国产美女久久久| 91精品久久久久久无码| 国产成人久久精品二区三区| 欧美精品一本久久男人的天堂| 精品国产乱码久久久久久1区2区| 男女久久久国产一区二区三区| 精品久久久无码人妻中文字幕| 奇米影视7777久久精品人人爽| 99久久国产综合精品女同图片| 久久久久波多野结衣高潮| 久久久久人妻精品一区|