问题描述: In LeetCode Store, there are some kinds of items to sell. Each item has a price. However, there are some special offers, and a special offer consists of one or more different kinds of item
题目链接:传送门(权限题) 大毒瘤QAQ 发现买过物品的商店构成一个联通块,所以钦定一个根,让所有买过物品的商店到根的路径上的商店都是买过物品的商店。 然后在上面跑树形背包,子状态设计: d p [ i ] [ j ] dp[i][j] dp[i][j]表示选到 i i i号节点,已经花了 j j j块钱,所能达到的最大喜爱度。 用dfs实现的树形dp会TLE,考虑用dfs序来优化: 按照df
题目描述 Saya and Kudo go shopping together. You can assume the street as a straight line, while the shops are some points on the line. They park their car at the leftmost shop, visit all the shops f
【题目来源】http://acm.hdu.edu.cn/showproblem.php?pid=2648【题目描述】 Every girl likes shopping,so does dandelion.Now she finds the shop is increasing the price every day because the Spring Festival is coming .S
【题目来源】http://acm.hdu.edu.cn/showproblem.php?pid=2648【题目描述】 Every girl likes shopping,so does dandelion.Now she finds the shop is increasing the price every day because the Spring Festival is coming .S