CF 1045 H. Self-exploration 考虑到串的结构一定是 1...0....1....0.....1... 这样的,而\(01\)与\(10\)在转折点交替出现 首先串长一定是\(a+b+c+d+1\)(分别代表\(00,01,10,11\)的数量),且首位一定是\(1\),还需要满足\(b=c\lor b=c-1\),先不考虑限制计数一波 我们发现,实际上我们需要把所有\(0\)中选择若干个作为转折点,然后\(1\)也这样,剩下的直接按照转折填进去就可以了 注意到\(0\)…