题目:
链接:点击打开链接
题意:
有n个朋友,编号为1......n。知道其中一些人相互认识,求最少需要多少桌子。
算法:
并查集算法的模板题。
(来源:LCY-teacher课件)
>>在某个城市里住着n个人,现在给定关于 n个人的m条信息(即某2个人认识)假设所有认识的人一定属于同一个单位,请计算该城市最多有多少单位?
>>如何实现...
分类:
其他好文 时间:
2014-05-22 08:03:40
阅读次数:
314
How Many Paths Are ThereTime Limit: 2000/1000 MS
(Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s):
1010Accepted Submission(s)...
分类:
其他好文 时间:
2014-05-22 05:40:33
阅读次数:
408
The design of travel bags and promotional gifts
are supported appropriately. This means that the authorities believe that many
things in addition to d...
分类:
其他好文 时间:
2014-05-22 02:12:01
阅读次数:
324
题目链接:uva 11038 - How Many O's?
题目大意:写出m到n之间的数,问需要写多少个0.
解题思路:f(x)表示从0到x需要写多少个0,于是给出区间[m,n]就有答案等于f(n)-f(m-1)。剩下的就是f(x)该如何求。枚举每个位置上可能为0的情况,这样就将这个数分成两个部分,在保证组成的数小于x的前提下,计算可以的组成方法。
例:x=12345,枚举十位为0...
分类:
其他好文 时间:
2014-05-21 15:01:51
阅读次数:
192
当入行压力测试时出现下列错误[root@zabbix~]#ab-n3000-c3000http://192.168.0.2/ThisisApacheBench,Version2.3<$Revision:655654$>Copyright1996AdamTwiss,ZeusTechnologyLtd,http://www.zeustech.net/LicensedtoTheApacheSoftwareFoundation,http://www.apache.org/Ben..
分类:
其他好文 时间:
2014-05-20 22:18:38
阅读次数:
397
http://acm.hdu.edu.cn/showproblem.php?pid=3038
1 #include 2 #include 3 #include 4 #define maxn 600000 5 using namespace std; 6
7 int f[maxn],d[max...
分类:
其他好文 时间:
2014-05-19 18:51:33
阅读次数:
252
题目描述After the hard tasks, It’s the easy time for
Y.G.Tobor and Y.D.I.Isha is a friend of Y.D.I, as he thinks Tobor is smart too,
he give Tobor a probl...
分类:
其他好文 时间:
2014-05-17 15:20:34
阅读次数:
248
TilingTime Limit: 1000MSMemory Limit:
65536KTotal Submissions: 7264Accepted: 3528DescriptionIn how many ways can you
tile a 2xn rectangle by 2x1 or 2x...
分类:
其他好文 时间:
2014-05-17 15:07:20
阅读次数:
245
Ubiquitous ReligionsTime Limit: 5000MSMemory
Limit: 65536KTotal Submissions: 22612Accepted: 11140DescriptionThere are so many
different religions in t...
分类:
其他好文 时间:
2014-05-15 20:44:25
阅读次数:
259
Because the 2014 may be the 23rd Anniversary
from theAir Jordan 6, In my opinion so many people are watching the following
New Jordan 6s Releases - Ca...
分类:
其他好文 时间:
2014-05-15 17:55:41
阅读次数:
366