• <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
            <2025年8月>
            272829303112
            3456789
            10111213141516
            17181920212223
            24252627282930
            31123456

            統計

            • 隨筆 - 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 閱讀(329) 評論(0)  編輯 收藏 引用 所屬分類: Algorithm

            精品熟女少妇AV免费久久 | 高清免费久久午夜精品| 久久婷婷成人综合色综合| 国产亚洲精品自在久久| 无码国内精品久久人妻麻豆按摩| 精品国产乱码久久久久久呢 | aaa级精品久久久国产片| 94久久国产乱子伦精品免费 | 亚洲精品国产字幕久久不卡| 久久精品国产99久久丝袜| 奇米综合四色77777久久| 日本精品久久久久中文字幕| 91久久精品91久久性色| 色99久久久久高潮综合影院 | 久久av免费天堂小草播放| 激情久久久久久久久久| 久久精品国产亚洲av麻豆小说 | 亚洲中文字幕久久精品无码喷水| 亚洲国产成人久久精品99| 久久久WWW成人免费毛片| 久久精品国产99久久久 | 久久久无码精品亚洲日韩蜜臀浪潮| 国产福利电影一区二区三区久久老子无码午夜伦不 | 精品午夜久久福利大片| 久久精品国产69国产精品亚洲| 久久毛片一区二区| 国产精品99久久久精品无码| 欧美性大战久久久久久| 久久人人爽人人爽AV片| 亚洲国产成人精品无码久久久久久综合 | 国产高潮久久免费观看| 精品国产一区二区三区久久| 精品永久久福利一区二区| 久久亚洲精品中文字幕| 久久久久久亚洲精品成人| 色综合久久无码中文字幕| 久久精品国产日本波多野结衣| 亚洲国产综合久久天堂| 免费精品久久天干天干| 久久国产精品77777| 国产精品久久影院|