CodeChef TANDEM

题目大意

我们定义一个字符串$s$为$\texttt{tandem}$当且仅当这个字符串能被表示三个相同的字符串$A$首尾相连的结果

对于一个字符串$s$的所有子串$s_{l \cdots r}$,如果它是一个$\texttt{tandem}$,则它是一个有趣的$\texttt{tandem}$当且仅当$s_l \not= s_{r+1}$,否则这就是一个无聊的$\texttt{tandem}$

现在,你需要统计有趣的和无聊的$\texttt{tandem}$的数量

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×