Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int t[26][MX],L,E[MX];
- void addW(char *c,int l){
- if(!L){F(26)t[i][0]=-1;L=1;*E=-1;}
- int nd(0);
- for(int i(0);i<l;++i)
- if(~t[c[i]-'a'][nd])
- nd=t[c[i]-'a'][nd];
- else{
- t[c[i]-'a'][nd]=L,E[nd=L++]=-1;
- F(26)t[i][nd]=-1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment