http://acm.hdu.edu.cn/showproblem.php?pid=4893
三种操作:
1 k d - "add"
2 l r - "query sum"
3 l r - "change to nearest Fibonacci"
节点附件三个值:
s1:由lazy控制的区间的正确的和。
s2:区间内与所有数相近的fib数之和,随着单点更新而更新...
分类:
其他好文 时间:
2014-08-05 09:39:19
阅读次数:
309
题目大意:有三不同颜色的球(yellow,blue, red),每两个不同颜色的球在一起就会变成剩下的种的颜色,例如,1个y,1个b 在一起就变成了两个r的。求能不能将给出的三种颜色的球都变成同一种颜色,如果能输出最少的转换步数。
策略:这道题假设有相同的那么显然就是相同的数目,如果没有相同的,如果能转化同一个颜色,那么必有(s - n)%3 == 0,即两种颜色的球的个数差,是3的倍数(仔细想...
分类:
其他好文 时间:
2014-08-04 11:09:47
阅读次数:
189
“Control panel” => “Ease of Access” => “Ease of Access Center” => “Make the computer easier to see” => “Set the thickness of the blinking cursor”. 8 p...
题目: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
PSU 从11.2.0.3.0 -> 11.2.0.3.11 遇冲突解决全程...
分类:
其他好文 时间:
2014-07-31 20:56:57
阅读次数:
275
用法./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