/**
hdu 1671 phone list
字典树和poj3630是同一道题
*/
#include <stdio.h>
#include <algorithm>
#include <string.h>
#define N 100000
struct tireTree
{
bool isNum;
tireTree *child[10];
}tt[N],*sp;
struct Phone
{
int len;
char s[11];
void input()
{
scanf("%s",s);
len = strlen(s);
}
}pl[N];
int insert(char *s,tireTree *&rt)
{
int num,i;
if(rt == NULL)
rt = sp++;
tireTree *loc = rt;
for(i = 0; s[i]; ++i)
{
num = s[i] - '0';
if(loc->child[num] == NULL)
loc->child[num] = sp++;
if(loc->child[num]->isNum)
return 0;
loc = loc ->
[字典树 ] hdu 1671 phone list
最新推荐文章于 2024-08-15 02:19:57 发布