http://acm.hdu.edu.cn/showproblem.php?pid=3887 【题意】 给定一棵树,给定这棵树的根 对于每个结点,统计子树中编号比他小的结点个数 编号从小到大一次输出 【思路】 从小到大处理每个结点,即统计当前结点的结果后,把当前结点插入到树状数组中 【AC】 1 # ...
分类:
编程语言 时间:
2017-08-23 21:41:43
阅读次数:
110
1. Remember to add it again after counting since there are still remaining information in cache. ...
分类:
其他好文 时间:
2017-08-23 14:52:16
阅读次数:
163
PHP垃圾回收机 阐述PHP的垃圾回收机制,在代码中用了unset,null,mysql_close,__destruct等等一些函数去释放对象防止内存溢出,“PHP 可以自动进行内存管理,清除不再需要的对象。PHP使用了引用计数(reference counting)这种单纯的垃圾回收(garba ...
分类:
Web程序 时间:
2017-08-19 23:42:48
阅读次数:
162
1.Combinations Counting(组合计数) 说明:我们有一个组合的例子——从给定的集合中选择几个元素的不同方法(不考虑顺序)。例如,如果这个男孩有4个糖果(不同种类的糖果),并且只取其中的2个,剩下的给他的妹妹,他有以下几种选择: N的集合中有多少K元素的组合(假设所有N个元素都是不 ...
分类:
编程语言 时间:
2017-08-19 20:14:02
阅读次数:
163
https://vjudge.net/problem/UVA-1640 题意:统计区间[l,r]中0——9的出现次数 数位DP 注意删除前导0 ...
分类:
其他好文 时间:
2017-08-19 17:09:36
阅读次数:
173
http://acm.hit.edu.cn/hoj/problem/view?id=2430 Submitted : 804, Accepted : 318 Submitted : 804, Accepted : 318 As most of the ACMers, wy's next target ...
分类:
其他好文 时间:
2017-08-19 12:53:25
阅读次数:
124
Given n integers. You have two operations: U A B: replace the Ath number by B. (index counting from 0) Q A B: output the length of the longest consecu ...
分类:
其他好文 时间:
2017-08-16 00:07:39
阅读次数:
227
题目描述 奶牛们又一次试图创建一家创业公司,还是没有从过去的经验中吸取教训--牛是可怕的管理者! 为了方便,把奶牛从 1 \cdots N(1 \leq N \leq 100, 000)1?N(1≤N≤100,000) 编号,把公司组织成一棵树,1 号奶牛作为总裁(这棵树的根节点)。除了总裁以外的每 ...
分类:
其他好文 时间:
2017-08-15 15:57:32
阅读次数:
187
Trung is bored with his mathematics homeworks. He takes a piece of chalk and starts writing a sequence of consecutive integers starting with 1 toN(1 < ...
分类:
其他好文 时间:
2017-08-15 10:07:57
阅读次数:
106
Counting Divisors Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 3170 Accepted Submission(s): ...
分类:
其他好文 时间:
2017-08-14 13:29:10
阅读次数:
287