01背包。 1 #include 2 #include 3 #include 4 5 
#define MAXN 1005 6 7 typedef struct { 8 int h, l, t; 9 } node_st;10 11 node_st 
nodes[35];12 13 in...
                            
                            
                                分类:
其他好文   时间:
2014-06-08 22:44:08   
                                阅读次数:
339
                             
                    
                        
                            
                            
                                //定义二维平面上的点struct Point{ int x; int y; 
Point(int a=0, int b=0):x(a),y(b){}};bool operator==(const Point& left, 
const Point& right){ return...
                            
                            
                                分类:
其他好文   时间:
2014-06-08 22:26:17   
                                阅读次数:
357
                             
                    
                        
                            
                            
                                1. 递归解法
/**
 * Definition for binary tree
 * struct TreeNode {
 *     int val;
 *     TreeNode *left;
 *     TreeNode *right;
 *     TreeNode(int x) : val(x), left(NULL), right(NULL) {}
 * };
 */
cl...
                            
                            
                                分类:
其他好文   时间:
2014-06-08 16:51:59   
                                阅读次数:
199
                             
                    
                        
                            
                            
                                求割点
const int maxn = 1010;
vector  a[maxn], bcc[maxn];
int pre[maxn];
int low[maxn];
bool iscut[maxn];
int bccno[maxn];
int cnt[maxn];
int dfs_clock;
int bcc_cnt;
int n;
struct Edge
{
	int u, v;
};...
                            
                            
                                分类:
其他好文   时间:
2014-06-08 05:54:36   
                                阅读次数:
270
                             
                    
                        
                            
                            
                                题目来源:Light OJ 1026 Critical Links
题意:输出桥
思路:模版
#include 
#include 
#include 
#include 
#include 
using namespace std;
const int maxn = 10010;
struct Edge
{
	int u, v;
	Edge(){}
	Edge(int u, int v):...
                            
                            
                                分类:
其他好文   时间:
2014-06-08 04:07:05   
                                阅读次数:
235
                             
                    
                        
                            
                            
                                题目来源:Light OJ 1291 Real Life Traffic
题意:最少添加几条边 可以使全图边双连通
思路:缩点 重新构图 答案就是(叶子节点数+1)/ 2
#include 
#include 
#include 
#include 
#include 
using namespace std;
const int maxn = 10010;
struct Edge
{
	i...
                            
                            
                                分类:
其他好文   时间:
2014-06-08 02:57:26   
                                阅读次数:
276
                             
                    
                        
                            
                            
                                1.多项式的系数存放在数组中
# include 
# include 
# define max(x,y) ((x)>(y)?(x):(y))
using namespace std;
const int N=100;
struct poly
{
int arr[N];
int mexp;
};
void add(poly &a,poly &b,poly &c)
{
	memset(c.ar...
                            
                            
                                分类:
其他好文   时间:
2014-06-08 02:17:57   
                                阅读次数:
264
                             
                    
                        
                            
                            
                                接上一篇Linux 内核 链表 的简单模拟(1) 第五章:Linux内核链表的遍历/*** 
list_for_each - iterate over a list* @pos: the &struct list_head to use as a 
loop cursor.* @...
                            
                            
                                分类:
系统相关   时间:
2014-06-07 22:09:58   
                                阅读次数:
451
                             
                    
                        
                            
                            
                                struct msghdr和struct 
cmsghdrhttp://blog.csdn.net/wsllq334/article/details/6977039structdescriptorcredentialsfilesocket数据结构 
理解struct msghdr当我第一次看到他时,他看...
                            
                            
                                分类:
其他好文   时间:
2014-06-07 22:02:02   
                                阅读次数:
1731
                             
                    
                        
                            
                            
                                #include#include#define	LIST_INIT_SIZE 
10/*线性表初始长度*/#define LIST_CREATENT 2/*每次的增量*/typedef int ElemType;using 
namespace std;typedef struct SqList/*线性...
                            
                            
                                分类:
其他好文   时间:
2014-06-07 21:01:21   
                                阅读次数:
322