HDU 1800 Flying to the Mars(字典树)(二)

2015-11-21 01:02:38 · 作者: · 浏览: 18
mp->next[i]); delete(temp); } int main() { int i,j; char ch[35]; int n; while(~scanf("%d",&n)) { root=(stud *)malloc(sizeof(stud)); for(i=0;i next[i]=NULL; root->num=0; ans=0; while(n--) { scanf("%s",ch); for(i=0;ch[i];i++) if(ch[i]!='0') break; insert(ch+i); } printf("%d\n",ans); delet(root); } return 0; }

?

?

?

?

?