• <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文不夠好?一開始以為組成一個單詞的兩個部分不能相同,后來刪除這個檢測之后AC了。
            很簡單,枚舉每個單詞分成哪兩個部分,看著兩個單詞在不在字典中。
            具體做法,使用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 閱讀(494) 評論(0)  編輯 收藏 引用 所屬分類: 題目分類:數據結構
            久久久www免费人成精品| 亚洲国产另类久久久精品| 99久久www免费人成精品| 久久精品国产一区| 欧美精品丝袜久久久中文字幕 | 久久精品这里只有精99品| 精品国产99久久久久久麻豆| 久久精品黄AA片一区二区三区| 99久久精品国产免看国产一区| 久久免费大片| 久久国产免费观看精品| 亚洲精品白浆高清久久久久久| 97久久精品人人澡人人爽| 国产精品久久久久久福利漫画| 久久久久久曰本AV免费免费| 午夜精品久久影院蜜桃| 嫩草影院久久国产精品| 日本精品久久久久中文字幕8| 亚洲狠狠婷婷综合久久蜜芽| 2021国产精品久久精品| 久久se精品一区二区影院| 99久久无色码中文字幕| 精品国际久久久久999波多野| 97久久久精品综合88久久| 久久99精品久久久久久久不卡| 国产精品无码久久久久久| 久久精品国产精品国产精品污| 久久99精品国产麻豆| 国产亚洲美女精品久久久| 亚洲国产一成久久精品国产成人综合| 国产成人无码精品久久久久免费| 国产99久久九九精品无码| 日本久久中文字幕| 久久精品卫校国产小美女| 99久久人人爽亚洲精品美女| 久久久噜噜噜久久中文字幕色伊伊| 成人久久免费网站| 久久亚洲AV无码西西人体| 久久国产亚洲精品无码| 久久久久久精品免费免费自慰| 久久国产精品99久久久久久老狼|