03 2015 档案

摘要:#include#include#include#include#includeusing namespace std;#define MAXN 9999#define MAXSIZE 10#define DLEN 4class BigNum{private: int a[500]; /... 阅读全文
posted @ 2015-03-15 17:47 scott_ding 阅读(170) 评论(0) 推荐(0)
摘要:给定n个模式串在主串中出现了几个#include #include const int MAXPT=500007; //最大节点数const int size=26; //子节点数const char start='a'; //子节点标号对应关系 class Ac_Automat{pr... 阅读全文
posted @ 2015-03-14 22:56 scott_ding 阅读(429) 评论(0) 推荐(0)
摘要:#include#include#include#includeusing namespace std ;const int maxn=100020;const int inf=0x3f3f3f3f;int dp[maxn];int a[maxn];int n;int LIS(int a[],in... 阅读全文
posted @ 2015-03-14 16:08 scott_ding 阅读(96) 评论(0) 推荐(0)
摘要:判断一个数是不是素数:bool prime(int n){ if(n==0||n==1) return false; if(n==2) return true; for(int i=2;i#include #include const int maxn = 1000001;int ... 阅读全文
posted @ 2015-03-12 22:51 scott_ding 阅读(175) 评论(0) 推荐(0)
摘要:__builtin_ffs(x) 返回右起第一个‘1’的位置。__builtin_clz(x) 返回左起第一个‘1’之前0的个数。__builtin_ctz(x) 返回右起第一个‘1’之后的0的个数。__builtin_popcount(x... 阅读全文
posted @ 2015-03-12 21:17 scott_ding 阅读(182) 评论(0) 推荐(0)