题目链接:Codeforces Round #419 (Div. 2) E. Karen and Supermarket 题意: 有n件物品,每个物品有一个价格,和一个使用优惠券的价格,不过这个优惠券有一个限制,必须要在第x个使用后才可以使用。现在有m的钱,问最多能买多少个物品。 题解: 每个优惠券 ...
分类:
其他好文 时间:
2017-07-10 16:28:47
阅读次数:
178
LINK 题意:给出n个商品,除第一个商品外,所有商品可以选择使用优惠券,但要求其前驱商品已被购买,问消费k以下能买几个不同的商品 思路:题意很明显就是树形DP。对于一个商品有三种选择,买且使用优惠券,买不使用优惠券,不买。当然如果直接暴力进行转移是$O(n^3)$的,但我们可以统计每个结点其子节点 ...
分类:
其他好文 时间:
2017-07-04 11:18:14
阅读次数:
178
传送门 1.贪心 + 优先队列 按照时间排序从前往后 很简单不多说 ——代码 1 #include <queue> 2 #include <cstdio> 3 #include <iostream> 4 #include <algorithm> 5 #define N 10001 6 7 int n ...
分类:
其他好文 时间:
2017-06-15 19:40:01
阅读次数:
154
Caisa is going to have a party and he needs to buy the ingredients for a big chocolate cake. For that he is going to the biggest supermarket in town. ...
分类:
其他好文 时间:
2017-05-19 22:10:24
阅读次数:
251
Hello Kiki Problem Description One day I was shopping in the supermarket. There was a cashier counting coins seriously when a little kid running and s ...
分类:
其他好文 时间:
2017-03-05 19:07:14
阅读次数:
191
Hello Kiki Problem Description One day I was shopping in the supermarket. There was a cashier counting coins seriously when a little kid running and s ...
分类:
其他好文 时间:
2017-01-20 22:20:24
阅读次数:
328
Cashier Employment Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 7997 Accepted: 3054 Description A supermarket in Tehran is open 24 hours ...
分类:
其他好文 时间:
2016-12-17 22:20:48
阅读次数:
163
Description Ignatius drinks milk everyday, now he is in the supermarket and he wants to choose a bottle of milk. There are many kinds of milk in the s ...
分类:
其他好文 时间:
2016-07-19 18:43:04
阅读次数:
124
题目链接:http://poj.org/problem?id=1456 题意是现有n个物品,每个物品有一个保质期和一个利润,现在每天只能卖一个商品,问最大的利润是多少,商品如果过期了就不能卖了; 暴力的方法: #include <iostream> #include <cstdio> #includ ...
分类:
其他好文 时间:
2016-05-13 09:52:48
阅读次数:
148