CF1276F Asterisk Substrings

题目描述

给定一个字符集为小写字母的长度为 $n$ 的字符串 $s$,设 $t_i$ 表示将 $s$ 中的第 $i$ 个字符替换为特殊字符 $\text{*}$ 时得到的字符串,比如当 $s=\text{abc}$ 时,$t_1=\text{*bc}$,$t_2 = \text{a*c}$,$t_3 = \text{ab*}$。 求字符串集合 $\{s,t_1,t_2,t_3,...,t_n\}$ 中本质不同的子串个数(需要计算空串)。 注意 $\text{*}$ 仅表示一个字符,不表示其他含义(如通配符)。

输入格式

输出格式

说明/提示

For the sample case, the distinct substrings are (empty string), a, b, c, \*, ab, a\*, bc, b\*, \*b, \*c, abc, ab\*, a\*c, \*bc.