Ubiquitous ReligionsTime Limit:5000MSMemory Limit:65536KTotal Submissions:23997Accepted:11807DescriptionThere are so many different religions in the w...
分类:
其他好文 时间:
2014-07-30 09:45:43
阅读次数:
198
题目来源:http://acm.hdu.edu.cn/showproblem.php?pid=1213典型的并查集,属于水题吧,但学会了路径压缩。 1 /*非递归,非路径压缩*/ 2 #include 3 const int maxn=1000+5; 4 int fa[maxn]; 5 void i...
分类:
其他好文 时间:
2014-07-29 20:58:42
阅读次数:
217
这是一道简单的并查集的题目,跟UVA 10608 Friends 差不多。
对于统计桌子的数目,我用了两种方法:
1、先将桌子数目初始化为n,然后合并一次就减一张。
2、先将朋友们分好组,在统计 fa[i]=i 的这些根节点有多少即为所求的桌子数。...
分类:
其他好文 时间:
2014-07-29 18:10:42
阅读次数:
213
HDU 1796 How many integers can you find(组合数学-容斥原理)
题目大意:
给你1个数n,再给m个数,问你1~n-1里面有多少个数能被这m个数的任意一个数整除。
解题思路:
利用容斥原理就可以解决。...
分类:
其他好文 时间:
2014-07-29 17:54:42
阅读次数:
197
Switch Game
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 10590 Accepted Submission(s): 6446
Problem Description
There are many la...
分类:
其他好文 时间:
2014-07-29 17:52:02
阅读次数:
203
cigarettes
时间限制:3000 ms | 内存限制:65535 KB
难度:2
描述
Tom has many cigarettes. We hypothesized that he has n cigarettes and smokes them
one by one keeping all the butts. Out of k > 1 butts h...
分类:
其他好文 时间:
2014-07-29 17:49:12
阅读次数:
158
In this tutorial, we will show you how to integrate Spring with Quartz scheduler framework. Spring comes with many handy classes to support Quartz, an...
分类:
编程语言 时间:
2014-07-29 17:38:12
阅读次数:
378
Description
Queues and Priority Queues are data structures which are known to most computer scientists. The Queue occurs often in our daily life. There are many people lined up at the lunch time.
...
分类:
其他好文 时间:
2014-07-29 14:47:38
阅读次数:
268
How many integers can you find
Time Limit: 12000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 3867 Accepted Submission(s): 1088
Problem Descripti...
分类:
其他好文 时间:
2014-07-29 14:19:08
阅读次数:
236
How many days?
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 5088 Accepted Submission(s): 3024
Problem Description
8600的手机每天消费1元,每...
分类:
其他好文 时间:
2014-07-29 12:53:16
阅读次数:
187