Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <cstdio>#include <cstring>typedef long long LL;LL ans;char s[100005],t[100005];int L,T,tt,vis[200005];struct node{node*ch[26],*pre;int len;LL cnt;void init(int _len=0){len=_len;cnt=1;memset(ch,0,sizeof(ch));pre=0;}}buff[200005],*p,*np,*q,*nq,*root=buff;int cnt;node* newnode(int _len=0){buff[++cnt].init(_len);return buff+cnt;}void ins(char c){np=newnode(p->len+1);for(;p;p=p->pre){if(!p->ch[c-'a'])