AC 自动机的一个状态的 fail 状态产生的方案也要加入当前状态
外加两组数据
input: 5 3 ab ba abba output: 52
input: 3 3 a b c output: 6 abc acb bac bca cab cba
虽然感觉只有我会犯这么弱智的错误