思路:如果把每种油漆看成一种状态,O(5^15)不行
DP[a][b][c][d][e][f]:a表示能凃一个的有多少个
b能凃2个的还有多少个
c能凃3个的还有多少个
d能凃4个的还有多少个
e能凃5个的还有多少个
last 上次凃的是:last个油漆。
所以这次如果选last-1个油漆的时候,数量还要减一,与上次不同
1 //#pragma comment(linker, "/STACK:167772160") 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include