costumes专题

Light oj 1422 Halloween Costumes(区间DP:迭代or记忆化搜索)

题目:1422 - Halloween Costumes 题意: 有n个party要参加,每次参加必须穿固定的衣服(ci),每次参加可以选择穿衣服或者脱衣服,也就是可以用外面的衣服将里面的衣服覆盖,后面需要就脱掉外面的把需要的衣服露出来,给出n次party要穿的衣服编号,求最少花费多少衣服 分析: 区间DP dp[i][j]表示从第i个party到第j个party所需的最少服装数 if

LightOJ 1422 Halloween Costumes

原题: Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as many parties as he can. Since it’s Halloween, these parties are all costume parties,