A =w= B 计数题,枚举A.C,算B.D的个数,注意减去重复的 我当时是f[1][n]->f[2][n]->f[3][n]->f[4][n]递推的 C 题意:长为n的字符串仅由'2' '3'组成,有m次交换机会,每次交换相邻的两个位置,求最终可以有多少个"233"子串(n<=100,m<=50) 分析:dp 首先明确的是,交换只可能交换相邻的2.3 考虑最终的状态,肯定是一些2,在这些2中间有若干个3,这些2的相对位置和刚开始的字符串相同 f[i][j…
BestCoder Sequence Problem Description Mr Potato is a coder. Mr Potato is the BestCoder. One night, an amazing sequence appeared in his dream. Length of this sequence is odd, the median number is M, and he named this sequence as Bestcoder Sequence. A…