• <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)
            久久久综合香蕉尹人综合网| 亚洲精品国产成人99久久| 狠狠色丁香婷婷综合久久来来去| 久久国产成人午夜AV影院| 久久综合视频网站| 伊人久久大香线蕉亚洲五月天| 日本三级久久网| 久久久亚洲欧洲日产国码二区| 91精品国产91久久久久久| 亚洲伊人久久成综合人影院 | 欧美午夜精品久久久久免费视| 99久久精品无码一区二区毛片| 伊人久久大香线蕉成人| 国产欧美一区二区久久| 久久亚洲美女精品国产精品| 精品久久国产一区二区三区香蕉| 亚洲中文字幕无码久久精品1 | 国产精品99久久久精品无码| 久久乐国产精品亚洲综合| 成人久久久观看免费毛片| 久久香蕉超碰97国产精品| 日批日出水久久亚洲精品tv| 久久久噜噜噜久久中文字幕色伊伊| 日韩人妻无码精品久久久不卡| 婷婷久久综合九色综合九七| 91精品国产91久久久久久| 999久久久免费国产精品播放| 蜜臀av性久久久久蜜臀aⅴ | 久久精品99久久香蕉国产色戒 | 蜜桃麻豆www久久| 国产亚洲欧美成人久久片| 久久久久亚洲AV无码网站| 亚洲AV日韩AV天堂久久| 成人久久免费网站| 亚洲中文久久精品无码ww16 | 国产精品久久影院| 久久99热国产这有精品| 伊人久久综在合线亚洲2019| 国产精品免费久久久久久久久| 亚洲国产精品综合久久网络| 欧美日韩中文字幕久久久不卡 |