摘要:
做了好长时间,害的苏神又跟我强调了一遍做dp的技巧。。。首先当然要枚举stamp的长度len了,然后设dp[j]['C']表示这个位置涂成c颜色最少需要几次,假如用c[k]染第j个格子,看j的前len-1个位置合不合法,合法就是颜色和第j格相同或者是‘*’啦,如果不合法,就跳出,如果合法,就更新dp[j]['C'] = min{dp[j]['C'],dp[k]['C']+1 (j-len# include # include # include # include # define maxi 0xfffffffusing name 阅读全文