2015 多校联赛 ——HDU5410(dp)】的更多相关文章

Sample Input 1 100 2 10 2 1 20 1 1   Sample Output 21 题意:共有m元钱和n种东西,求每种单价p,而且你买x个该种物品可以得到Ax+B个,求m元钱最多能得到多少. 思路:先01背包处理出A+B的情况,再用完全背包往里算加A能得到的情况. #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<cm…
Sample Input 4 3 9 1 1 2 6 3 9 1 2 3 3 5 2 3 1 1 1 1 1 9 9 9 1 2 3 4 5 6 7 8 9   Sample Output 1 0 10 60 题意: 已知有两个门,要求将人分为两组,两组的“和”分别等于两个门的数字,当然也可以全部进入一个门 思路:(NeverMoreH) 如果能找到满足题意的解,一定满足a和b的和等于n个人的标号的和,所以我们只需要判断n个人的标号组成a的情况有多少(或者只判断b,一样),同时还要注意可以把n个…
Sample Input 2 00?0 1 2 4 8 ???? 1 2 4 8   Sample Output Case #1: 12 Case #2: 15 ?部分可以是0  or  1,将二进制转化成格雷码后,哪里是 1 就可以取相应的数,求得到数的最大值 ①:判断连续的?的个数奇偶不同,两边是否相等.在有时会去掉一个最小值.(感觉写着很麻烦) #include <iostream> #include <cstdio> #include <vector> #inc…
Zero Escape Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 289    Accepted Submission(s): 135 Problem Description Zero Escape, is a visual novel adventure video game directed by Kotaro Uchiko…
Virtual Participation Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 237    Accepted Submission(s): 56 Special Judge Problem Description As we know, Rikka is poor at math. Yuta is worrying abo…
Connect the Graph Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 108    Accepted Submission(s): 36 Special Judge Problem Description Once there was a special graph. This graph had n vertices a…
Tricks Device Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1977    Accepted Submission(s): 509 Problem Description Innocent Wu follows Dumb Zhang into a ancient tomb. Innocent Wu’s at the en…
Crazy Bobo Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 1215    Accepted Submission(s): 366 Problem Description Bobo has a tree,whose vertices are conveniently labeled by 1,2,...,n.Each nod…
Fantasy magicians usually gain their ability through one of three usual methods: possessing it as an innate talent, gaining it through study and practice, or receiving it from another being, often a god, spirit, or demon of some sort. Some wizards ar…
Solve this interesting problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 422    Accepted Submission(s): 98 Problem Description Have you learned something about segment tree? If not, don’t…