比较恶心的题目不难发现是在自动机上做数位dp注意要考虑前导0,题目中给出的233是幸运数,20233不是为此我非常猥琐的写了一个四维dp,用记忆化搜索实现 ; ..,..,..,..] of longint; trie:..,'] of longint; q,f:..] of longint; can:..] of boolean; ans,i,n,m,t,j,k,l:longint; s,ss:ansistring; ch:char; procedure ac; var h,r,i,x,y:l…