题目:uva674 - Coin Change(完全背包)
题目大意:给1 5 10 25 50 这5中面值的硬币,然后给出N,问用这些钱组成N的不同方式数目。1 5 和 5 1 表示同一中,顺序不同算相同。
解题思路:完全背包。 状态方程:dp【j】 += dp【 j - v【i】】;
代码:
#include
#include
const int N = ...
分类:
其他好文 时间:
2014-08-03 20:39:55
阅读次数:
219
题目:下列操作Change operations:0 a b change all characters into '0's in [a , b]1 a b change all characters into '1's in [a , b]2 a b change all '0's into...
分类:
其他好文 时间:
2014-08-02 15:06:23
阅读次数:
266
第一题HDU1698http://acm.hdu.edu.cn/showproblem.php?pid=1698这是在区间上进行整段的修改操作,我们就用to[]数组代表修改的lazy标记记住在构建树和在change函数中自顶向下更新的时候,一定要注意重新回去更新上层的节点,所以末尾需加上update...
分类:
其他好文 时间:
2014-08-02 01:47:52
阅读次数:
342
1. Don‘t design your page, and then change it with DOM manipulations In jQuery, you design a page, and then you make it dynamic. This is because jQuery was designed for augmentation and has grown i...
分类:
Web程序 时间:
2014-08-01 14:01:12
阅读次数:
1354
小需求是当你在第一个下拉框选择了国家时,会自动更新第二个省份的下拉框,效果如下两个下拉选择Html如下:Jquery绑定一个change函数jQuery('#country_select').change(function() { onCountrySelect...
分类:
其他好文 时间:
2014-08-01 13:01:42
阅读次数:
418
用法./change 23456 10, 按最后指定的进制显示
#include
#include
#include
int mystrlen(char *s)
{
int len=0;
char *temp=s;
while(*(temp)!='\0')
{
++len;
++temp;
}
return le...
分类:
其他好文 时间:
2014-07-31 16:57:06
阅读次数:
224
The volume label for my new USB disk is displayed as capital letters on my home PC although when I formatted this disk (FAT32) on Windows, I used lowe...
分类:
移动开发 时间:
2014-07-31 13:02:26
阅读次数:
344
Midlife for many is a time of transition, a time of questioning and a time of change, not just physically, but emotionally and mentally. It’s when you...
分类:
其他好文 时间:
2014-07-31 02:18:35
阅读次数:
325
已知,中华人民共和国的纸币面额分别为:100元、50元、20元、10元、5元、2元、1元,输入钱数,输出最小的货币方案。int main(){ int value[7] = { 100, 50, 20, 10, 5, 2, 1 }, count[7], change; int i, j,...
分类:
其他好文 时间:
2014-07-30 20:29:14
阅读次数:
167
很典型的线段树,注意就是一个数字如果变成了斐波那契数字之后如果在change的话,它是不会反生改变的,因为最近的斐波那契数字就是它本身了啊。
用一个flag表示这一段上的数字是否change过,如果flag == 1已经change过,就不会在向下更新。否则的话就进行更新,最后会到达一个节点,更新这个节点。这里用暴力更新就行,找到最近的斐波那契数字。
Add就是一个点更新,sum求和就是一个区...
分类:
其他好文 时间:
2014-07-30 10:07:43
阅读次数:
438