摘要:
There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this "How far is it if I want 阅读全文
摘要:
LCA ,也就是最近公共祖先是什么意思呢。 下面这张图可能会让你清楚的明白什么是最近公共祖先。 对于初始点,前提是它能构成一棵不成环的树,之所以不能成环,从定义就看出来了嘛,如果成环,是不是有种1是3的父亲,3是6的父亲,6又是1的父亲的感觉。O(∩_∩)O哈哈~ 那么我们又从上面一句话能看出另一个 阅读全文
摘要:
树状数组和线段树的那些事 共同点:线段树,树状数组都是用来快速搜索。 线段树通过分支查找,树状数组通过用二进制快速查找,树状数组的查询和更新时间复杂度都是O(logN),通常来说,树状数组能做的线段树都能解决。线段树的范围更广。 但是树状数组的范围虽然小,但是执行效率却比线段树高了不少。 树状数组在 阅读全文
摘要:
前几天听学长讲了背包,感觉有点难,于是慢慢琢磨,先是听学长分析,后来自己看崔添翼的背包问题九讲 2.0 beta 1.2 那个PDF,再结合网上的许多大牛写的背包讲解,还有就是题目的练习,终于有点体会了。 常见的几类背包问题 1、01背包 题目 有 N 件物品和一个容量为 V 的背包。放入第 i 件 阅读全文
摘要:
Bone Collector II Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4948 Accepted Submission(s): 25 阅读全文
摘要:
Nowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don't know that Computer College had ever been split into 阅读全文
摘要:
The Fewest Coins Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 6615 Accepted: 2039 Description Farmer John has gone to town to buy some f 阅读全文
摘要:
Coins Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 37959 Accepted: 12882 Description People in Silverland use coins.They have coins of v 阅读全文
摘要:
Dividing Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 71507 Accepted: 18648 Description Marsha and Bill own a collection of marbles. The 阅读全文
摘要:
On January 1st 2002, The Netherlands, and several other European countries abandoned their national currency in favour of the Euro. This changed the e 阅读全文