• <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>
            #include <stdio.h>
            #include 
            <string.h>
            #include 
            <stdlib.h>

            #define MAX 100000

            struct Trie
            {
                
            int num;
                Trie
            * next[10];
            }a[MAX];

            Trie  root;
            int   location,num;

            void initial()
            {
                root.num
            = -1;
                
                memset( root.next, 
            0sizeof(root.next) );
                location
            = 0, num= 0;
            }

            void insert( char* s )
            {
                Trie
            * r= &root;
                
                
            while*s )
                {
                    
            int t= *s- '0';
                    
                    
            if( r->next[t]== NULL )
                    {
                        r
            ->next[t]= &a[location];
                        
                        a[location].num
            = -1;
                        memset( a[location].next, 
            0sizeof(a[location].next) );
                        
                        location
            ++;
                    }
                    
                    r
            = r->next[t];
                    s
            ++;
                }
                
                
            if( r->num== -1 ) r->num= num++;
            }

            bool find( char* s )
            {
                Trie
            * r= &root;
                
                
            while*s )
                {
                    
            int t= *s- '0';
                    
            if( r->next[t]== NULL ) return false;
                    
                    r
            = r->next[t];
                    s
            ++;
                }
                
                
            forint i= 0; i< 10++i )
                
            if( r->next[i] ) return true;
                
                
            return false;
            }

            int n;
            char str[10010][11];

            int main()
            {
                
            int test;
                scanf(
            "%d",&test);
                
                
            while( test-- )
                {
                    scanf(
            "%d",&n);
                    initial();
                    
                    
            forint i= 0; i< n; ++i ) 
                    {
                        scanf(
            "%s", str[i] );
                        insert( str[i] );
                    }
                    
                    
            bool ok= true;
                    
            forint i= 0; i< n; ++i )
                    
            if( find( str[i] ) )
                    {
                        ok
            = false;
                        
            break;
                    }
                    
                    
            if( ok ) puts("YES");
                    
            else     puts("NO");
                }
                
                
            return 0;
            }
            posted on 2008-11-25 11:54 Darren 閱讀(333) 評論(0)  編輯 收藏 引用
            人妻精品久久无码专区精东影业 | 久久久久国产精品麻豆AR影院 | 26uuu久久五月天| 久久精品国产亚洲7777| 一本一本久久a久久精品综合麻豆| 一级做a爰片久久毛片毛片| 无码人妻精品一区二区三区久久久| 久久不见久久见免费视频7| 精品国产青草久久久久福利| 久久久久99这里有精品10 | 久久最新精品国产| 久久精品视频一| 亚洲伊人久久大香线蕉苏妲己| 中文字幕无码精品亚洲资源网久久 | 97精品伊人久久久大香线蕉| 亚洲AⅤ优女AV综合久久久| 国产V亚洲V天堂无码久久久| 色播久久人人爽人人爽人人片AV| 中文字幕成人精品久久不卡| 18岁日韩内射颜射午夜久久成人| 久久99精品免费一区二区| 国产精品久久毛片完整版| 伊人久久大香线焦AV综合影院| 久久久黄片| 久久国产精品成人免费| 久久综合给合久久狠狠狠97色69| 亚洲精品乱码久久久久久蜜桃 | 日本福利片国产午夜久久| 亚洲精品无码专区久久久| 思思久久99热免费精品6| 激情久久久久久久久久| 91性高湖久久久久| 色综合久久最新中文字幕| 国产成人久久精品一区二区三区 | 国产免费久久久久久无码| 精品999久久久久久中文字幕| 亚洲va久久久噜噜噜久久男同 | 99999久久久久久亚洲| 久久久久久无码Av成人影院| 久久精品亚洲一区二区三区浴池 | 日韩精品无码久久久久久|