先跟罗大神小白他们刷简单dp,刷完dp1再来补。。。 Codeforces 659G Fence Divercity【计数DP】
http://codeforces.com/problemset/problem/659/G