# Include <stdio. h> # include <string. h> # include <stdlib. h> # define zero 0 const int first_char = '0'; char num [11111] [20]; typedef struct node {struct node * child [20]; /* store the next character */int n;/* record the number of times the current word appears */} node, * node; node root; /* The root node of the dictionary tree (no characters are stored) * // * Insert the word */void insert (char * Str) {int I, index, Len; node current = NULL, newnode = NULL; Len = strlen (STR); current = root;/* start with the root node */for (I = 0; I <Len; I ++)/* Insert characters one by one */{Index = STR [I]-first_char; /* obtain the subscript of this character */If (current-> child [Index]! = NULL)/* The character is already in the dictionary tree */{current = Current-> child [Index];/* modify the current node location */(current-> N) + +;/* The current word appears again. If the character */} else/* has not appeared, the node */{newnode = (node) calloc (1, sizeof (node);/* Add a node and initialize */current-> child [Index] = newnode; current = newnode; /* modify the current node location */current-> n = 1; /* this new word appears */}/* search for the word */INT find_word (char * Str) {int I, index, Len; node current = NULL; Len = strlen (Str ); Current = root;/* Search Start from the root node */for (I = 0; I <Len; I ++) {Index = STR [I]-first_char; /* obtain the subscript of this character */If (current-> child [Index]! = NULL)/* The current character exists in the dictionary tree */{current = Current-> child [Index];/* modify the location of the current node */} else {return zero; /* the word does not match after comparison. The dictionary tree does not contain this word */} If (current-> N)> 1) return 1; return 0 ;} void release (node root) {int I; If (null = root) {return ;}for (I = 0; I <20; I ++) {If (root-> child [I]! = NULL) {release (root-> child [I]) ;}} free (Root); root = NULL;} int main () {int I, n, m, check; scanf ("% d", & N); While (n --) {scanf ("% d", & M); root = (node) calloc (1, sizeof (node); // n times wrong for (I = 0; I <m; I ++) {scanf ("% s", num [I]); insert (Num [I]);} Check = 0; for (I = 0; I <m; I ++) {If (find_word (Num [I]) {check = 1; break ;}}if (check = 1) printf ("NO \ n"); If (check = 0) printf ("Yes \ n"); release (Root);} return 0 ;}