• <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>
            心如止水
            Je n'ai pas le temps
            posts - 400,comments - 130,trackbacks - 0
            是題目沒有說清楚,還是我E文不夠好?一開始以為組成一個(gè)單詞的兩個(gè)部分不能相同,后來刪除這個(gè)檢測之后AC了。
            很簡單,枚舉每個(gè)單詞分成哪兩個(gè)部分,看著兩個(gè)單詞在不在字典中。
            具體做法,使用STL中的set即可。
            以下是我的代碼:
            #include<iostream>
            #include
            <string>
            #include
            <vector>
            #include
            <set>
            #include
            <algorithm>
            #include
            <cstdio>
            using namespace std;

            int main()
            {
                
            /*
                freopen("data.in","r",stdin);
                freopen("data.out","w",stdout);
                //
            */
                
                
            set<string> words_set;
                
            string s;
                
            while(cin>>s)
                    words_set.insert(s);
                
                vector
            <string> ans;
                
            for(set<string>::const_iterator i=words_set.begin();i!=words_set.end();i++)
                {
                    
            string t(*i);
                    
            for(int pos=1;pos<t.size();pos++)
                    {
                        
            string part1(t.begin(),t.begin()+pos);
                        
            if(!words_set.count(part1))
                            
            continue;
                        
            string part2(t.begin()+pos,t.end());
                        
            if(!words_set.count(part2))
                            
            continue;
                        ans.push_back(t);
                        
            break;
                    }
                }
                sort(ans.begin(),ans.end());
                
                
            for(vector<string>::const_iterator i=ans.begin();i!=ans.end();i++)
                    cout
            <<*i<<endl;
                
            return 0;
            }
            posted on 2011-03-06 19:13 lee1r 閱讀(501) 評(píng)論(0)  編輯 收藏 引用 所屬分類: 題目分類:數(shù)據(jù)結(jié)構(gòu)
            久久夜色精品国产噜噜亚洲a| 无码AV波多野结衣久久| 国产午夜电影久久| 亚洲а∨天堂久久精品9966| 欧美精品久久久久久久自慰| 99久久精品费精品国产| 久久精品青青草原伊人| 人人狠狠综合久久亚洲88| 狠狠色丁香久久婷婷综合图片| 久久青青草原精品国产| 日韩欧美亚洲国产精品字幕久久久 | 久久久亚洲精品蜜桃臀| 精品综合久久久久久97| 久久99精品国产99久久6| 少妇内射兰兰久久| 伊人久久国产免费观看视频| 久久精品国产精品青草app| 国产精品99久久久精品无码| 国产69精品久久久久9999| 色8久久人人97超碰香蕉987| 久久亚洲2019中文字幕| 日韩人妻无码精品久久免费一| 久久伊人色| 久久精品国产WWW456C0M| 国内精品九九久久久精品| 久久国产色av免费看| 色综合久久久久综合99| 日本久久久久久久久久| 久久久精品人妻无码专区不卡| 97超级碰碰碰久久久久| 久久精品国产亚洲av高清漫画| 热99RE久久精品这里都是精品免费| 国产激情久久久久影院老熟女免费| 超级碰碰碰碰97久久久久| 久久久久亚洲AV片无码下载蜜桃| 色综合久久久久| 久久电影网2021| 99久久精品国产综合一区| 久久伊人精品青青草原高清| 精品免费tv久久久久久久| 色综合久久中文色婷婷|