码迷,mamicode.com
首页 >  
搜索关键字:define    ( 25272个结果
【POJ】3630 Phone List
静态字典树。 1 #include 2 #include 3 #include 4 5 #define MAXN 10005 6 7 typedef struct Trie { 8 bool v; 9 Trie *next[10];10 Trie() {11 ...
分类:其他好文   时间:2014-06-28 09:39:33    阅读次数:171
[NOI2010]超级钢琴 划分树+堆
#include#include#include#include#includeusing namespace std;#define N 510000struct P{ int x,y; P(int a=0,int b=0){x=a,y=b;} bool operator=k)retu...
分类:其他好文   时间:2014-06-28 09:30:59    阅读次数:148
zoj3080 ChiBi --- floyd求连通块内最短路
此题最大最小搞的太复杂。。。并查集维护连通块,连通块内floyd就可以了 #include #include #include #include #include #include #include #include #include #define inf 0x3f3f3f3f #define eps 1e-6 #define ll __int64 using...
分类:其他好文   时间:2014-06-28 08:57:24    阅读次数:218
PKU 2774 Long Long Message (后缀数组练习模板题)
题意:给你两个字符串,求最长公共字串的长度。 by:罗穗骞模板 #include #include #include #include using namespace std; #define M 303 #define inf 0x3fffffff #define maxn 500000 #define ws ww #define rank RANK #define F(x)...
分类:其他好文   时间:2014-06-28 08:00:24    阅读次数:190
poj 3678 2-sat
2-sat经典建图,注意AND为1的时候,a=0要和a=1连边,b同理,因为此时a,b都不能为0。 OR为0时候,a=1要和a=0连边,b同理,因为此时a,b都不能为1。 #include #include #include #include #include #include using namespace std; #define maxn 1005 vector g[maxn*2]; b...
分类:其他好文   时间:2014-06-28 07:52:39    阅读次数:197
hdu2159 FATE 二维背包
感觉用背包去想反而麻烦。。就是一个递推 #include #include #include #include #include #include #include #include #define inf 0x3f3f3f3f #define ll __int64 using namespace std; int n,v,k,s,dp[110][110],w[110]...
分类:其他好文   时间:2014-06-28 07:30:04    阅读次数:208
hdu-4035-Maze-树上的概率dp
对于叶子节点和非叶子节点非别列公式。 然后化简公式。 和非树上的差不多。。 #include #include #include #include #include #include #include using namespace std; #define eps 1e-9 #define zero(x) ((fabs(x)<eps?0:x)) #define maxn 11000 #de...
分类:其他好文   时间:2014-06-28 07:15:49    阅读次数:263
#define中的rettype和##
# define DEF(func, kind, rettype, args...) rettype tern_ ## func (unsigned insid, ##args); 上面的rettype是宏参数,在实际使用DEF宏时,在rettype位置要有一个参数,然后在宏内容里rettype位置就会被替换为你提供的参数;##用于连接前后两个参数,把它们变成一个字符串。 DEF(...
分类:其他好文   时间:2014-06-28 07:15:10    阅读次数:1352
linux字符设备驱动
本篇文章记录字符设备的驱动框架:1.定义cdev接口体和class结构体#define HELLO_CNT 2static int major = 0;//主设备号为0,需要让系统自动生成主设备号static struct cdev hello_cdev;static struct class *c...
分类:系统相关   时间:2014-06-27 22:36:58    阅读次数:423
全局匹配KMP算法
KMP算法是通过分析模式字符串,预先计算每个位置发生不匹配的时候,所需GOTO的下一个比较位置,整理出来一个next数组,然后在上面的算法中使用。本全局匹配KMP算法针对串的堆式存储数据结构# define MAXSIZE 45 //固定next数组的长度# define OK 1# define....
分类:其他好文   时间:2014-06-27 22:29:03    阅读次数:677
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!