题目链接: codeforces 149D Coloring Brackets 题目描述: 给一个合法的括号串,然后问这串括号有多少种涂色方案,当然啦!涂色是有限制的. 1,每个括号只有三种选择:涂红色,涂蓝色,不涂色. 2,每对括号有且仅有其中一个被涂色. 3,相邻的括号不能涂相同的颜色,但是相邻的括号可以同时不涂色. 解题思路: 这个题目的确是一个好题,无奈我太蠢,读错题意.以为(())这样的括号序列在涂色的时候,第一个括号与第三个括号也可以看做是一对.这样的话还要统计合法的括号匹配数目,还…