锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产自产精品,欧美视频中文字幕,性欧美videos另类喷潮http://m.shnenglu.com/MiYu/category/14730.html ______________鐧界櫧銇眿zh-cnSun, 24 Oct 2010 08:57:39 GMTSun, 24 Oct 2010 08:57:39 GMT60trie鏍?-璇﹁Вhttp://m.shnenglu.com/MiYu/archive/2010/10/23/131017.htmlMiYuMiYuSat, 23 Oct 2010 14:05:00 GMThttp://m.shnenglu.com/MiYu/archive/2010/10/23/131017.htmlhttp://m.shnenglu.com/MiYu/comments/131017.htmlhttp://m.shnenglu.com/MiYu/archive/2010/10/23/131017.html#Feedback0http://m.shnenglu.com/MiYu/comments/commentRss/131017.htmlhttp://m.shnenglu.com/MiYu/services/trackbacks/131017.html闃呰鍏ㄦ枃

MiYu 2010-10-23 22:05 鍙戣〃璇勮
]]>
鏋佸害 YM....鑷繁鐢╰rie鍐欎簡涓吉 map....( HDU 1075 )http://m.shnenglu.com/MiYu/archive/2010/08/25/124721.htmlMiYuMiYuWed, 25 Aug 2010 11:41:00 GMThttp://m.shnenglu.com/MiYu/archive/2010/08/25/124721.htmlhttp://m.shnenglu.com/MiYu/comments/124721.htmlhttp://m.shnenglu.com/MiYu/archive/2010/08/25/124721.html#Feedback0http://m.shnenglu.com/MiYu/comments/commentRss/124721.htmlhttp://m.shnenglu.com/MiYu/services/trackbacks/124721.html

MiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?nbsp;______________鐧界櫧銇眿    

 

榪欏嚑澶╀竴鐩村緢YM..... 綰犵粨.....  鍋氫釜姘撮 1075......WA N嬈?....YM.
(  寰堢畝鍗曠殑涓棰?  媯(gè)绱㈣緭鍏ョ殑涓叉槸鍚﹀瓨鍦? 瀛樺湪灝辨浛鎹㈣緭鍑? 涓嶅瓨鍦ㄧ洿鎺ヨ緭鍑哄氨鍙互浜?)
鏈鍚庢棤濂? 綰疌++ STL..榪囦簡, 鏃墮棿绔熺劧鐢ㄤ簡 1600+MS 榪樻槸 C++浜ょ殑,  G++瑕?400+MS,  涓?br style="word-wrap: break-word; line-height: normal; ">鏄庣櫧涓轟粈涔堟椂闂村樊閭d箞澶?  鐢╰rie 鍋氫簡嬈? 250MS...   鏀逛簡濂藉嚑嬈℃晥鐜囬兘涓婁笉鏉?nbsp;  ....  YM 涓?鎶妕rie 鍐欐垚浜?浼?map ,鍙湁涓鐐圭畝鍗曠殑鍔熻兘,
鍏朵粬鐨勪笉鎯沖啓浜?  鍐欏緱濂藉鏉?................... 
浼?map 浠g爜濡備笅 :  濂介暱.....................
/*
MiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?______________鐧界櫧銇眿
          http://www.cnblog.com/MiYu
Author By : MiYu
Test      : 4
Program   : 1075
*/

#include <iostream>
#include <string>
using namespace std;
typedef struct dict DIC;
DIC *root = NULL;
string ext = "";
struct dict {
       dict (){ str = "";memset ( child , 0 , sizeof ( child ) ); }
       ~dict () { }
       void del ( DIC * node );
       string & insert ( char *ins,char *key = NULL );
       string & find ( char *ins );
       string & operator [] ( char *a );
       string & operator = ( char *a );
       DIC *child[26];
       string str; 
};
void dict::del ( DIC * node )
{
     if ( node == NULL ) return;
     for ( int i = 0; i != 26; ++ i )
     {
          if ( node->child[i] != NULL )  del ( node->child[i] );
     }
     node->str = "";
     free ( node );  
}
string & dict::operator [] ( char *a )
{
       string &str = find ( a );
       if ( str == "" )
           return  insert ( a );  
       return str;
}
string & dict::operator = ( char *a )
{
      return this->str = a; 
}
string & dict::insert ( char *ins,char *key )
{
            DIC *cur = this,*now;
            int len = strlen ( ins );
            for ( int i = 0; i != len; ++ i )
            {
                  if ( cur->child[ ins[i] - 'a' ] != NULL ) 
                  {
                       cur = cur->child[ ins[i] - 'a' ];
                  }
                  else
                  {
                       now = new DIC;
                       cur->child[ ins[i] - 'a' ] = now;
                       cur = now;
                  }
            } 
            return cur->str;
}
string & dict::find ( char *ins )
{
            DIC *cur = this;
            int len = strlen ( ins );
            for ( int i = 0; i != len; ++ i )
            {
                 if ( cur->child[ ins[i] - 'a' ] != NULL )
                      cur = cur->child[ ins[i] - 'a' ];  
                 else
                      return ext; 
            } 
            return cur->str;
}
char words[3010],temp[12],t[12];
int main ()
{
    DIC dict;
    root = &dict;
    scanf ( "%s", t );
    while ( scanf ( "%s", t ), strcmp ( t, "END" ) != 0 )
    {
           scanf ( "%s", temp );
           dict[temp] = t;
    }
    scanf ( "%s", t );
    getchar();
    while ( gets ( words ) && strcmp ( words, "END" ) != 0 )
    {
           memset ( temp, 0, sizeof ( temp ) );
           int len = strlen ( words );
           for ( int i = 0,j = 0; i != len; ++ i )
           {
                if ( isalpha ( words[i] ) )
                {
                     temp[j++] = words[i];
                } 
                else 
                {
                     temp[j] = '\0';
                     string str = dict[ temp ];
                     if ( str == "" )
                          printf ( "%s",temp ); 
                     else
                          printf ( "%s",str.c_str() );
                     putchar ( words[i] );
                     j = 0; 
                }
           }
           putchar ( 10 );
    }
    return 0;
}

 

 STL 浠g爜濡備笅 :  濂界煭....

 /*

MiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?______________鐧界櫧銇眿

          http://www.cnblog.com/MiYu

Author By : MiYu

Test      : 1

Program   : 1075

*/


#include <iostream>

#include <string>

#include <map>

using namespace std;

string words,temp;

map < string , string > mp;

int main ()

{

    cin >> words;

    while ( cin >> words, words != "END" )

    {

           cin >> temp;

           mp[ temp ] = words;

    }

    cin >> words;

    getchar();

    while ( getline ( cin, words ) && words != "END" )

    {

           string out = "";

           int len = words.size();

           for ( int i = 0; i != len; ++ i )

           {

                if ( isalpha ( words[i] ) )

                {

                     out += words[i];

                } 

                else 

                {

                     if ( mp[out] == "" )

                          cout << out; 

                     else

                          cout << mp[out];

                     cout << words[i];

                     out = ""; 

                }

           }

           cout << endl;

    }

    return 0;

}


 

 

 

 



MiYu 2010-08-25 19:41 鍙戣〃璇勮
]]>
HDOJ 1800 HDU 1800 Phone List ACM 1800 IN HDUhttp://m.shnenglu.com/MiYu/archive/2010/08/25/124657.htmlMiYuMiYuWed, 25 Aug 2010 03:54:00 GMThttp://m.shnenglu.com/MiYu/archive/2010/08/25/124657.htmlhttp://m.shnenglu.com/MiYu/comments/124657.htmlhttp://m.shnenglu.com/MiYu/archive/2010/08/25/124657.html#Feedback0http://m.shnenglu.com/MiYu/comments/commentRss/124657.htmlhttp://m.shnenglu.com/MiYu/services/trackbacks/124657.html

MiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?nbsp;______________鐧界櫧銇眿    

 

棰樼洰鍦板潃:

      http://acm.hdu.edu.cn/showproblem.php?pid=1800 

棰樼洰鎻忚堪:

Problem Description

In the year 8888, the Earth is ruled by the PPF Empire . As the population growing , PPF needs to find more land for the newborns . Finally , PPF decides to attack Kscinow who ruling the Mars . Here the problem comes! How can the soldiers reach the Mars ? PPF convokes his soldiers and asks for their suggestions . “Rush … ” one soldier answers. “Shut up ! Do I have to remind you that there isn’t any road to the Mars from here!” PPF replies. “Fly !” another answers. PPF smiles :“Clever guy ! Although we haven’t got wings , I can buy some magic broomsticks from HARRY POTTER to help you .” Now , it’s time to learn to fly on a broomstick ! we assume that one soldier has one level number indicating his degree. The soldier who has a higher level could teach the lower , that is to say the former’s level > the latter’s . But the lower can’t teach the higher. One soldier can have only one teacher at most , certainly , having no teacher is also legal. Similarly one soldier can have only one student at most while having no student is also possible. Teacher can teach his student on the same broomstick .Certainly , all the soldier must have practiced on the broomstick before they fly to the Mars! Magic broomstick is expensive !So , can you help PPF to calculate the minimum number of the broomstick needed .
For example : 
There are 5 soldiers (A B C D E)with level numbers : 2 4 5 6 4;
One method :
C could teach B; B could teach A; So , A B C are eligible to study on the same broomstick.
D could teach E;So D E are eligible to study on the same broomstick;
Using this method , we need 2 broomsticks.
Another method:
D could teach A; So A D are eligible to study on the same broomstick.
C could teach B; So B C are eligible to study on the same broomstick.
E with no teacher or student are eligible to study on one broomstick.
Using the method ,we need 3 broomsticks.
……

After checking up all possible method, we found that 2 is the minimum number of broomsticks needed. 
 

Input
Input file contains multiple test cases. 
In a test case,the first line contains a single positive number N indicating the number of soldiers.(0<=N<=3000)
Next N lines :There is only one nonnegative integer on each line , indicating the level number for each soldier.( less than 30 digits);
 

Output
For each case, output the minimum number of broomsticks on a single line.
 

Sample Input
4 10 20 30 04 5 2 3 4 3 4
 

Sample Output
1 2
 

棰樼洰鍒嗘瀽:

 

鐩稿鏉ヨ榪欓鐢ㄥ瓧鍏告爲(wèi)鐨勬晥鐜囨瘮杈冮珮浜?....閬楁喚鐨勬槸鎴戠幇鍦ㄥ彧浼?xì)鍋氫竴浜涘瓧鍏告爲(wèi)鐨?姘撮....瀵瑰瓧鍏告爲(wèi)鐨勭悊瑙g幇鍦ㄨ繕涓嶆槸寰堝ソ......鎵浠?鍛靛懙

榪欓鎴戝氨鐩存帴絳涢夎繃浜?.......

 

浠g爜濡備笅:

 /*

MiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?______________鐧界櫧銇眿

          http://www.cnblog.com/MiYu

Author By : MiYu

Test      : 1

Program   : 1800

*/


#include <iostream>

#include <algorithm>

using namespace std;

int num[3002];

bool hash[3002];

bool cmp ( const int &a, const  int &b )

{

     return a > b; 

}

int main ()

{

    int N;

    while ( scanf ( "%d", &N ) != EOF )

    {

           memset ( num, 0, 12008 );

           memset ( hash, 0, 3002 );

           for ( int i = 0; i != N; ++ i )

                 scanf ( "%d",num + i );

           sort ( num, num + N, cmp );

           int nCount = 0;

           for ( int i = 0; i < N; ++ i )

           {

                 if ( !hash[i] )

                 {

                      nCount ++;

                      int j = i ,k = j+1;

                      hash[j] = true;

                      while ( k < N ) 

                      {

                            if ( !hash[k] && num[k] < num[j] )

                            {

                                 hash[k] = true;

                                 j = k;

                            }

                            k++;

                      } 

                 }

           } 

           printf ( "%d\n",nCount );

    }

    return 0;

}


 

 



MiYu 2010-08-25 11:54 鍙戣〃璇勮
]]>
HDOJ 1247 HDU 1247 Hat鈥檚 Words ACM 1247 IN HDUhttp://m.shnenglu.com/MiYu/archive/2010/08/25/124658.htmlMiYuMiYuWed, 25 Aug 2010 03:54:00 GMThttp://m.shnenglu.com/MiYu/archive/2010/08/25/124658.htmlhttp://m.shnenglu.com/MiYu/comments/124658.htmlhttp://m.shnenglu.com/MiYu/archive/2010/08/25/124658.html#Feedback0http://m.shnenglu.com/MiYu/comments/commentRss/124658.htmlhttp://m.shnenglu.com/MiYu/services/trackbacks/124658.html

MiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?nbsp;______________鐧界櫧銇眿    

 

棰樼洰鍦板潃 :

     http://acm.hdu.edu.cn/showproblem.php?pid=1247 

棰樼洰鎻忚堪:

Hat’s Words

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 1384    Accepted Submission(s): 506


Problem Description
A hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary.
You are to find all the hat’s words in a dictionary.
 

Input
Standard input consists of a number of lowercase words, one per line, in alphabetical order. There will be no more than 50,000 words.
Only one case.
 

Output
Your output should contain all the hat’s words, one per line, in alphabetical order.
 

Sample Input
a ahat hat hatword hziee word
 

Sample Output
ahat hatword
 

棰樼洰鍒嗘瀽 :

  

        瀛楀吀鏍?wèi)鐨勯鐩? 榪欎釜棰樼殑鏂規(guī)硶姣旇緝鏆村姏,  鍦ㄨ緭鍏ョ殑鏃跺欏皢姣忎釜鍗曡瘝閮藉姞鍏ュ瓧鍏告爲(wèi),  騫剁敤鏁扮粍灝嗘墍鏈夌殑涓查兘瀛樿搗鏉ユ潵.

鍦ㄨ緭鍏ュ畬鎴愬悗,  瀵規(guī)瘡涓崟璇嶈繘琛屾媶鍒? 涔熷氨鏄毚鍔涙灇涓懼崟璇嶄笉鍚屼綅緗殑鍓嶅悗閮ㄥ垎, 鐪嬪湪瀛楀吀鏍?wèi)涓槸鍚﹀瓨鍦? 瀛樺湪鍗寵緭鍑?

涓嶈繃璨屼技鏁版嵁姣旇緝寮? 璇存槸鎸夊瓧鍏擱『搴忚緭鍑? 浣嗗叾瀹炰粬鐨勮緭鍏ユ湰灝辨槸鎸夊瓧鍏擱『搴忚緭鍏ョ殑, 鎵浠ュ皢鎺掑簭涔熼潰浜?, 鍛靛懙.

    鍙﹀,鍏跺疄榪欓鐢⊿TL 鍋氭洿綆鍗? 褰撶劧榪芥眰鏁堢巼闄ゅ.

trie 浠g爜:

 /*

MiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?______________鐧界櫧銇眿

          http://www.cnblog.com/MiYu

Author By : MiYu

Test      : 1

Program   : 1247

*/


#include <iostream>

#include <algorithm>

#include <string>

using namespace std;

typedef struct dictor DIC;

DIC *root = NULL;

struct dictor {

       dictor (){ exist = false; memset ( child , 0 , sizeof ( child ) ); }

       void insert ( char *ins );

       bool find ( const char *ins );

private:

       DIC *child[26];

       bool exist; 

};

void dictor::insert ( char *ins )

{

            DIC *cur = root,*now;

            int len = strlen ( ins );

            for ( int i = 0; i < len; ++ i )

            {

                  if ( cur->child[ ins[i] - 'a' ] != NULL ) 

                  {

                       cur = cur->child[ ins[i] - 'a' ];

                  }

                  else

                  {

                       now = new DIC;

                       cur->child[ ins[i] - 'a' ] = now;

                       cur = now;

                  }

            } 

            cur->exist = true;

}

bool dictor::find ( const char *ins )

{

            DIC *cur = root;

            int len = strlen ( ins );

            for ( int i = 0; i < len; ++ i )

            {

                 if ( cur->child[ ins[i] - 'a' ] != NULL )

                      cur = cur->child[ ins[i] - 'a' ];  

                 else

                      return false; 

            } 

            return cur->exist;

}

char words[50050][100];

char s1[100],s2[100];

DIC dict;

int main ()

{

    root = &dict;

    int n = 0;

    while ( scanf ( "%s",words[n] ) != EOF )

    {

            dict.insert ( words[n++] );

    }

    for ( int i = 0; i < n; ++ i )

    {

          int len = strlen ( words[i] );

          for ( int j = 1; j < len; ++ j )

          {

                memset ( s1, 0, sizeof ( s1 ) );

                memset ( s2, 0, sizeof ( s2 ) );

                strncpy ( s1, words[i], j );

                strcpy ( s2, words[i]+j );

                if ( dict.find ( s1 ) && dict.find ( s2 ) )

                {

                     printf ( "%s\n", words[i] );

                     break; 

                }

          }  

    }  

    //system ( "pause" );

    return 0;

}


STL  浠g爜 :

 

 /*

MiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?______________鐧界櫧銇眿

          http://www.cnblog.com/MiYu

Author By : MiYu

Test      : 2

Program   : 1247

*/


#include <iostream>

#include <string>

#include <map>

using namespace std;

map < string , int > mp;

string str[50005];

int main ()

{

    int n = 0;

    while ( cin >> str[n] ) mp[ str[n++] ] = 1;

    for ( int i = 0; i < n; ++ i )

    {

          unsigned len = str[i].size ();

          for ( unsigned j = 1; j < len; ++ j )

          {

               string s1 ( str[i], 0, j );

               string s2 ( str[i], j );

               if ( mp[s1] == 1 && mp[s2] == 1 )

               {

                    cout << str[i] << endl; 

                    break;

               }

          } 

    }

    return 0;

}


 

 



MiYu 2010-08-25 11:54 鍙戣〃璇勮
]]>
HDOJ 1671 HDU 1671 Phone List ACM 1671 IN HDUhttp://m.shnenglu.com/MiYu/archive/2010/08/25/124655.htmlMiYuMiYuWed, 25 Aug 2010 03:39:00 GMThttp://m.shnenglu.com/MiYu/archive/2010/08/25/124655.htmlhttp://m.shnenglu.com/MiYu/comments/124655.htmlhttp://m.shnenglu.com/MiYu/archive/2010/08/25/124655.html#Feedback0http://m.shnenglu.com/MiYu/comments/commentRss/124655.htmlhttp://m.shnenglu.com/MiYu/services/trackbacks/124655.html闃呰鍏ㄦ枃

MiYu 2010-08-25 11:39 鍙戣〃璇勮
]]>
HDOJ 1251 HDU 1251 緇熻闅鵑 ACM 1251 IN HDUhttp://m.shnenglu.com/MiYu/archive/2010/08/25/124654.htmlMiYuMiYuWed, 25 Aug 2010 03:38:00 GMThttp://m.shnenglu.com/MiYu/archive/2010/08/25/124654.htmlhttp://m.shnenglu.com/MiYu/comments/124654.htmlhttp://m.shnenglu.com/MiYu/archive/2010/08/25/124654.html#Feedback0http://m.shnenglu.com/MiYu/comments/commentRss/124654.htmlhttp://m.shnenglu.com/MiYu/services/trackbacks/124654.html

MiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?nbsp;______________鐧界櫧銇眿    

 

棰樼洰鍦板潃:

     http://acm.hdu.edu.cn/showproblem.php?pid=1251 

棰樼洰鎻忚堪:

緇熻闅鵑

Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131070/65535 K (Java/Others)
Total Submission(s): 5025    Accepted Submission(s): 1853


Problem Description
Ignatius鏈榪戦亣鍒頒竴涓毦棰?鑰佸笀浜ょ粰浠栧緢澶氬崟璇?鍙湁灝忓啓瀛楁瘝緇勬垚,涓嶄細(xì)鏈夐噸澶嶇殑鍗曡瘝鍑虹幇),鐜板湪鑰佸笀瑕佷粬緇熻鍑轟互鏌愪釜瀛楃涓蹭負(fù)鍓嶇紑鐨勫崟璇嶆暟閲?鍗曡瘝鏈韓涔熸槸鑷繁鐨勫墠緙).
 

Input
杈撳叆鏁版嵁鐨勭涓閮ㄥ垎鏄竴寮犲崟璇嶈〃,姣忚涓涓崟璇?鍗曡瘝鐨勯暱搴︿笉瓚呰繃10,瀹冧滑浠h〃鐨勬槸鑰佸笀浜ょ粰Ignatius緇熻鐨勫崟璇?涓涓┖琛屼唬琛ㄥ崟璇嶈〃鐨勭粨鏉?絎簩閮ㄥ垎鏄竴榪炰覆鐨勬彁闂?姣忚涓涓彁闂?姣忎釜鎻愰棶閮芥槸涓涓瓧絎︿覆.

娉ㄦ剰:鏈鍙湁涓緇勬祴璇曟暟鎹?澶勭悊鍒版枃浠剁粨鏉?
 

Output
瀵逛簬姣忎釜鎻愰棶,緇欏嚭浠ヨ瀛楃涓蹭負(fù)鍓嶇紑鐨勫崟璇嶇殑鏁伴噺.
 

Sample Input
banana band bee absolute acm ba b band abc
 

Sample Output
2 3 1 0
 

 

 

棰樼洰鍒嗘瀽:

    鍒氬瀛楀吀鏍?,涔熷氨鏄?trie 鏍? 鏁欑▼寰堝鏄撶湅鏄庣櫧, 1251 鏄竴閬撳緢鏄庢樉鐨?妯℃澘棰? 鐪嬭繃 PPT 鍚?鐩存帴鏁蹭唬鐮?1A.

絎竴嬈″仛, 欏轟究浠嬬粛涓?trie鏍?:

瀛楀吀鏍?wèi)锛圱rie錛夋槸涓縐嶇敤浜庡揩閫熷瓧絎︿覆媯(gè)绱㈢殑澶氬弶鏍?wèi)缁撴瀯銆傚叾鍘熺悊鏄埄鐢ㄥ瓧絎︿覆鐨勫叕鍏卞墠緙鏉ラ檷浣庢椂絀哄紑閿,浠庤岃揪鍒版彁楂樼▼搴忔晥鐜囩殑鐩殑銆?/p>

銆銆瀹冩湁濡備笅綆鍗曠殑鎬ц川錛?/p>

銆銆銆銆(1) 鏍硅妭鐐逛笉鍖呭惈瀛楃淇℃伅錛?/p>

銆銆銆銆(3) 涓媯祄搴︾殑Trie鎴栬呬負(fù)絀猴紝鎴栬呯敱m媯祄搴︾殑Trie緇勬垚銆?/p>

銆銆 鎼滅儲瀛楀吀欏圭洰鐨勬柟娉曚負(fù)錛?/p>

銆銆銆銆(1) 浠庢牴緇撶偣寮濮嬩竴嬈℃悳绱紱

銆銆銆銆(2) 鍙栧緱瑕佹煡鎵懼叧閿瘝鐨勭涓涓瓧姣嶏紝騫舵牴鎹瀛楁瘝閫夋嫨瀵瑰簲鐨勫瓙鏍?wèi)銆銆銆銆銆銆騫惰漿鍒拌瀛愭爲(wèi)緇х畫榪涜媯(gè)绱紱

銆銆銆銆(3) 鍦ㄧ浉搴旂殑瀛愭爲(wèi)涓婏紝鍙栧緱瑕佹煡鎵懼叧閿瘝鐨勭浜屼釜瀛楁瘝錛?/p>

銆銆銆銆銆銆騫惰繘涓姝ラ夋嫨瀵瑰簲鐨勫瓙鏍?wèi)杩涜妫绱€?/p>

銆銆銆銆(4) 榪唬榪囩▼……

銆銆銆銆(5) 鍦ㄦ煇涓粨鐐瑰錛屽叧閿瘝鐨勬墍鏈夊瓧姣嶅凡琚彇鍑猴紝鍒欒鍙?/p>

銆銆銆銆銆銆闄勫湪璇ョ粨鐐逛笂鐨勪俊鎭紝鍗沖畬鎴愭煡鎵俱?/span>

浠g爜濡備笅 :

    褰撶劧涔熷彲浠ユ嬁鏉ュ仛妯℃澘 ,    

 /*

MiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?______________鐧界櫧銇眿

          http://www.cnblog.com/MiYu

Author By : MiYu

Test      : 1

Program   : 1251

*/


#include <iostream>

using namespace std;

typedef struct dict DIC;

struct dict {

       dict (){ n = 0; memset ( child , 0 , sizeof ( child ) ); }

       void insert ( char *ins )

       {

            DIC *cur = this,*now;

            int len = strlen ( ins );

            if ( len == 0 )  return ;

            for ( int i = 0; i != len; ++ i )

            {

                  if ( cur->child[ ins[i] - 'a' ] != NULL ) 

                  {

                       cur = cur->child[ ins[i] - 'a' ];

                       cur->n ++; 

                  }

                  else

                  {

                       now = new DIC;

                       cur->child[ ins[i] - 'a' ] = now;

                       now->n ++;

                       cur = now;

                  }

            } 

       }

       int find ( char *ins )

       {

            DIC *cur = this;

            int len = strlen ( ins );

            if ( 0 == len )  return 0;

            for ( int i = 0; i != len; ++ i )

            {

                 if ( cur->child[ ins[i] - 'a' ] != NULL )

                      cur = cur->child[ ins[i] - 'a' ];  

                 else

                      return 0; 

            } 

            return cur->n;

       }

private:

       DIC *child[26];

       int n; 

};

char word[11];

int main ()

{

    DIC dict;

    while ( gets ( word ), strcmp ( word, "") != 0 )

          dict.insert ( word );

    char qur[11];

    while ( scanf ( "%s",qur ) != EOF )

    {

          printf ( "%d\n",dict.find ( qur ) ); 

    }    

    return 0;

}


 

 



MiYu 2010-08-25 11:38 鍙戣〃璇勮
]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            亚洲国产精品久久久久秋霞蜜臀| 久久国产一区二区| 亚洲视频中文字幕| 亚洲欧洲一区二区三区久久| 激情久久影院| 91久久中文| 99亚洲伊人久久精品影院红桃| 91久久在线| 一本色道**综合亚洲精品蜜桃冫| 亚洲精品中文在线| 亚洲一区二区在线免费观看| 西西裸体人体做爰大胆久久久| 久久成人一区二区| 欧美1区2区3区| aa国产精品| 久久国产免费| 欧美日韩成人| 国产一区二区三区直播精品电影| 一区二区三区在线免费视频| 亚洲美女精品一区| 亚欧成人精品| 亚洲小少妇裸体bbw| 亚洲大片免费看| 欧美日韩成人激情| 久久免费视频观看| 国产精品v欧美精品v日韩精品| 亚洲性视频网址| 亚洲精品综合久久中文字幕| 亚洲福利在线看| 久久成人免费日本黄色| 欧美日韩一区二区在线| …久久精品99久久香蕉国产 | 9色国产精品| 老色鬼精品视频在线观看播放| 日韩视频一区二区三区| 免费欧美在线| 在线观看av一区| 久久免费观看视频| 久久国产精品亚洲77777| 国产欧美日韩精品丝袜高跟鞋| 欧美一区二区三区在线免费观看| 亚洲高清不卡在线| 欧美日韩国产另类不卡| 国产欧美日韩在线观看| 亚洲区中文字幕| 久久亚洲高清| 亚洲欧美另类久久久精品2019| 欧美激情综合网| 在线看片欧美| 久久久久久亚洲精品杨幂换脸| 99国内精品久久| 欧美激情精品久久久六区热门| 国产亚洲欧美日韩日本| 小黄鸭精品aⅴ导航网站入口| 亚洲精品永久免费| 欧美剧在线观看| 亚洲人成网站777色婷婷| 久久久久国产精品一区| 亚洲欧美日韩另类| 国产人成一区二区三区影院| 亚洲一区二区三区四区在线观看 | 亚洲欧美一区二区三区久久| 亚洲精品乱码久久久久久| 美女图片一区二区| 亚洲高清资源| 欧美国产91| 欧美v日韩v国产v| 亚洲国产精品久久人人爱蜜臀| 美女主播一区| 女人色偷偷aa久久天堂| 亚洲日本成人女熟在线观看| 欧美成人激情在线| 欧美国产精品久久| 在线一区免费观看| 一区二区欧美亚洲| 国产精品免费网站| 久久久精品2019中文字幕神马| 久久爱91午夜羞羞| 亚洲国产婷婷| 99精品热视频只有精品10| 欧美性大战xxxxx久久久| 午夜精品成人在线| 久久精品一区二区三区中文字幕 | 亚洲欧美三级伦理| 久久xxxx精品视频| 亚洲精品国产精品乱码不99| 亚洲免费精彩视频| 国产麻豆精品在线观看| 久久人人九九| 欧美日韩国产色站一区二区三区| 亚洲一区二区3| 久久国产精品99国产| 亚洲国产天堂久久国产91| 一区二区三区四区五区视频| 国产啪精品视频| 亚洲国产成人av| 国产精品一区二区视频| 另类酷文…触手系列精品集v1小说| 欧美成人dvd在线视频| 国产欧美一区二区精品婷婷| 久久影视三级福利片| 欧美美女操人视频| 久久综合中文色婷婷| 欧美人与禽猛交乱配视频| 久久久久亚洲综合| 欧美无乱码久久久免费午夜一区| 久久综合999| 国产精品美女久久久| 亚洲第一精品夜夜躁人人爽| 国产麻豆成人精品| 夜夜躁日日躁狠狠久久88av| 国产日韩欧美在线视频观看| 91久久精品www人人做人人爽| 国产一区二区三区电影在线观看| 亚洲国产清纯| 亚洲成色777777在线观看影院 | 欧美mv日韩mv国产网站| 久久国产精品久久久久久电车| 欧美精品在线观看| 能在线观看的日韩av| 国产精品一区=区| 99热这里只有精品8| 亚洲国产成人一区| 久久精品二区三区| 久久精品一区蜜桃臀影院| 国产精品白丝av嫩草影院 | 亚洲男人的天堂在线| 老色批av在线精品| 久久最新视频| 国产一区二区三区电影在线观看| 一区二区欧美在线观看| 一区二区三区 在线观看视频 | 夜夜夜久久久| 这里只有精品丝袜| 欧美精品二区| 亚洲日本成人| 一区二区三区精品在线| 欧美久久婷婷综合色| 亚洲六月丁香色婷婷综合久久| 亚洲久色影视| 欧美人与性动交cc0o| 亚洲精品视频免费在线观看| 日韩一区二区免费高清| 欧美激情一区二区三区四区| 亚洲高清色综合| 99国产精品私拍| 欧美日韩一区二区免费视频| 99热精品在线观看| 亚洲欧美网站| 国产亚洲精品美女| 久久久久**毛片大全| 女主播福利一区| 亚洲精品视频二区| 欧美三级日本三级少妇99| 一区二区三区高清在线| 欧美一区二区高清| 极品av少妇一区二区| 免费成人在线观看视频| 日韩网站在线观看| 欧美在线一二三区| 一区二区三区在线视频播放| 欧美v国产在线一区二区三区| 亚洲毛片av在线| 国产亚洲欧美激情| 噜噜爱69成人精品| 亚洲精品护士| 欧美亚洲网站| 激情视频一区| 欧美日本在线视频| 午夜精品一区二区三区四区| 久久久蜜桃一区二区人| 亚洲精品欧美在线| 国产亚洲欧美日韩日本| 欧美h视频在线| 亚洲自拍偷拍视频| 欧美成人一区二区| 午夜欧美大片免费观看| 亚洲大胆人体在线| 国产精品嫩草影院av蜜臀| 久久九九精品| 亚洲视频第一页| 欧美二区在线播放| 欧美一区在线看| 亚洲精品一区二区三区樱花| 国产欧美日韩在线视频| 欧美成人性生活| 欧美一区二区日韩| 99ri日韩精品视频| 欧美大片在线影院| 久久九九免费| 亚洲欧美不卡| 亚洲三级影院| 在线日韩日本国产亚洲| 国产欧美一区二区精品仙草咪| 欧美激情一区二区三区四区| 欧美影视一区| 午夜激情综合网| 亚洲图片欧美午夜| 亚洲精品资源| 亚洲国产另类久久精品|