水题,上trie,然后穷举每一位的时候判定一下三种编辑 ..*,..] of longint; v:..*] of longint; d:..] of boolean; s:string; t,i,l,n,m:longint; procedure add(w:longint); var p,i,y:longint; begin p:=; to length(s) do begin y:=ord(s[i])-; then begin inc(t); son[p,y]:=t; end; p:=son…