题意:求一个无向图的,去掉两个不同的点后最多有几个连通分量。
 思路:枚举每个点,假设去掉该点,然后对图求割点后连通分量数,更新最大的即可。算法相对简单,但是注意几个细节:
1:原图可能不连通。
2:有的连通分量只有一个点,当舍去该点时候,连通分量-1;
复习求割点的好题!
#include
#include
#include
using namespace std;
i...
                            
                            
                                分类:
其他好文   时间:
2014-05-23 07:56:52   
                                阅读次数:
317
                             
                    
                        
                            
                            
                                每个cpu都有队列来处理接收到的帧,都有其数据结构来处理入口和出口流量,因此,不同cpu之间没有必要使用上锁机制,。此队列数据结构为softnet_data(定义在include/linux/netdevice.h中):
/*
 * Incoming packets are placed on per-cpu queues so that
 * no locking is needed....
                            
                            
                                分类:
系统相关   时间:
2014-05-23 07:29:17   
                                阅读次数:
514
                             
                    
                        
                            
                            
                                HDU 题目分类
 模拟题, 枚举
1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 1049 1050 1057 1062 1063 1064 1070 1073 1075 1082 1083 1084 1088 1106 1107 1113 1117 1...
                            
                            
                                分类:
其他好文   时间:
2014-05-22 11:59:02   
                                阅读次数:
198
                             
                    
                        
                            
                            
                                解题思路:
给出一堆单词,看能不能找到 一个或几个单词相连,使得首字母为b,末字母为m,如果可以输出YES,否则NO。 如果几个单词相连,要求相邻单词首末字母相同,如 big got them.思路是建立状态表,边输入边建立表, 比如单词ab,则c[0][1]=1,输入结束后,初步的表建立完成,那么连接单词,就要查找,根据状态表,找以b开头的单词,b-a,b-c,b-d.....z,最多找25次...
                            
                            
                                分类:
其他好文   时间:
2014-05-22 11:56:29   
                                阅读次数:
232
                             
                    
                        
                            
                            
                                Robberies http://acm.hdu.edu.cn/showproblem.php?pid=2955
     背包;第一次做的时候把概率当做背包(放大100000倍化为整数):在此范围内最多能抢多少钱   最脑残的是把总的概率以为是抢N家银行的概率之和…
 把状态转移方程写成了f[j]=max{f[j],f[j-q[i].v]+q[i].money}(f[j]表示在概...
                            
                            
                                分类:
其他好文   时间:
2014-05-22 09:43:12   
                                阅读次数:
282
                             
                    
                        
                            
                            
                                N皇后问题
Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 7743    Accepted Submission(s): 3481
Problem Description
在N*N的方格棋盘放置了N个皇后,使得它...
                            
                            
                                分类:
其他好文   时间:
2014-05-22 08:21:38   
                                阅读次数:
147
                             
                    
                        
                            
                            
                                题目:
    链接:点击打开链接
题意:
    有n个朋友,编号为1......n。知道其中一些人相互认识,求最少需要多少桌子。
算法:
    并查集算法的模板题。
    (来源:LCY-teacher课件)
    >>在某个城市里住着n个人,现在给定关于 n个人的m条信息(即某2个人认识)假设所有认识的人一定属于同一个单位,请计算该城市最多有多少单位?
  >>如何实现...
                            
                            
                                分类:
其他好文   时间:
2014-05-22 08:03:40   
                                阅读次数:
314
                             
                    
                        
                            
                            
                                HDU 3910 Liang Guo Sha
题目大意:
	If both of them choose “Sha”, then Alice gets A points, and Bob loses A points; if both of them choose “Shan”, then Alice gets B points, and Bob loses B points; otherwise, Bob gets C points, and Alice loses C points.  
	给定A B ...
                            
                            
                                分类:
其他好文   时间:
2014-05-22 06:22:40   
                                阅读次数:
281
                             
                    
                        
                            
                            
                                [root@localhost ~]# date -R     // 查看时区
Mon, 19 May 2014 10:18:46 +0000
[root@localhost ~]# tzselect   // 设置修改时区
Please identify a location so that time zone rules can be set correctly.
Please select a continent or ocean....
                            
                            
                                分类:
其他好文   时间:
2014-05-20 15:49:50   
                                阅读次数:
319
                             
                    
                        
                            
                            
                                利用filter函数可以从wrapper set中过滤符合条件的DOM元素。
如果我们有一个内容如下的html文件,要获取类为external的<a>元素,使用filter可以很easy地搞定。
link
link
link
link
link
link
link
link
link
filter的参数类型可分为两种:
1 传递选择器
2 传递过滤函数
如果使...
                            
                            
                                分类:
Web程序   时间:
2014-05-20 14:04:02   
                                阅读次数:
337