• <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 閱讀(501) 評論(0)  編輯 收藏 引用 所屬分類: 題目分類:數據結構
            乱亲女H秽乱长久久久| 亚洲国产精品久久久久网站| 91麻豆国产精品91久久久| 亚洲色欲久久久综合网东京热| 久久久久av无码免费网| 久久久无码精品亚洲日韩按摩| 97久久精品人人做人人爽| 久久婷婷五月综合色99啪ak| 久久婷婷激情综合色综合俺也去 | 久久精品水蜜桃av综合天堂| 国产免费久久精品99久久| 人妻精品久久久久中文字幕69| 久久人人爽人人爽AV片| 国产精品久久久久9999| 亚洲精品无码久久久久AV麻豆| 日本久久久精品中文字幕| 7777久久久国产精品消防器材| 久久久黄片| 国产午夜福利精品久久| 久久精品人人做人人爽97 | 午夜肉伦伦影院久久精品免费看国产一区二区三区 | 美女久久久久久| 青青草原综合久久| 99久久99久久久精品齐齐| 99蜜桃臀久久久欧美精品网站 | 久久亚洲日韩精品一区二区三区| 色偷偷88欧美精品久久久| 久久久WWW成人| 久久久久久极精品久久久 | 久久综合精品国产一区二区三区| 久久久91精品国产一区二区三区 | 日日狠狠久久偷偷色综合0 | 潮喷大喷水系列无码久久精品| 午夜不卡久久精品无码免费 | 亚洲国产精品久久久久婷婷老年 | 久久精品中文无码资源站| yy6080久久| .精品久久久麻豆国产精品| 国产精品久久久久无码av| 久久精品国产99国产精偷| 99久久精品国产麻豆|