AT_agc058_b [AGC058B] Adjacent Chmax

AT_agc058_b [AGC058B] Adjacent Chmax

转化为对某个区间染色,然后设 \(f_{i, j}\) 为前 \(i\) 种颜色染了 \([1, j]\) 的方案数,简单转移即可。