- 博客(63)
- 资源 (5)
- 收藏
- 关注
原创 我在pku AC的代码
http://d.download.youkuaiyun.com/down/1756932/soberman密码是:zstuacmer希望对acm的新人们有帮助~~~~ 因为本人现在已经退役(大四了),所以文章里的一些博文没来得及写完(并不是要要回复才能看到)~~
2009-11-10 15:23:00
543
原创 baby-step qiant-step
/*hdu 2815zstu 1815pku 3243hust 1234b^x=n(mod p)给定b,n,p计算经最值,or输出no solution*/#include#include#include#include#include#include#includeusing namespace std;struct z
2009-05-03 11:52:00
599
2
原创 算法链接汇总
题目。资源。评论。代码(注释)。应用 图论算法:1、图的连通性,搜索 最大团欧拉回路(混合图的欧拉回路)无向连通图的割点,割边(桥),双连通分量。 有向图的强连通分支(图的收缩问题,图的点基,2-SAT)有向图无向图的最小环。拓扑排序 2、图论—匹配 二分图的最大匹配(最小路径覆盖,最小点覆盖) 二分图的最优匹配(KM算法) 一
2009-03-10 23:20:00
1333
原创 数论其他算法的综合运用
/*hdu 2815zstu 1815pku 3243hust 1234b^x=n(mod p)给定b,n,p计算经最值,or输出no solution*/#include#include#include#include#include#include#includeusing namespace std;struct z
2009-03-10 23:10:00
565
原创 解不定方程a*x+b*y=c
/*zstu 2021*//*这是解a*x+b*y=1的算法,如果要求a*x+b*y=n,只要结果乘以n就可以了*、#includeint gcd(int a,int b,int*x,int *y){ int temp,r; if(a%b==0) { *x=0; *y=1; return b; } r=gcd(b,a%b,x,y); tem
2009-03-10 23:09:00
1054
原创 多边形的核(半平面交算法)
//看代码前最好看下zzy的论文!!!!王飞的资料里有 #include#include#include#includeusing namespace std;const double eps = 1e-8;const int MaxN = 50005;typedef struct{double x, y;}Point;typedef struct{do
2009-03-10 23:04:00
2184
原创 凸包及其应用
//坐标是整形的凸包算法int dblcmp(double t){ if(fabs(t) < 1e-8) return 0; return (t > 0) ? 1 : -1;}//求向量叉积abXac > 0 c 在ab逆时针方向int Cross(Point a, Point b, Point c){ return (b.x-a.x)*(c.y-
2009-03-10 23:03:00
1374
原创 牛顿迭代法、迭代逼近
/*zstu 求一元三次方程的根要求1附近的根,只要把x0初始化为1代入,然后牛顿迭代1000次就出结果了*/#includedouble c[4],d[3];double f(double x){ double fac=1,sum=0; int i; for(i=0;i<4;i++) { sum+=fac*c[i]; fac*=x; }
2009-03-10 23:01:00
1061
原创 高精度算法
/* ID: linjd821 LANG: C++ TASK: 高精度模板 */ //高精度模板,注意本模板并没有考虑中间会出现负数的情况 #include #include #include #include #include #include #include #include #include
2009-03-10 23:00:00
2347
1
原创 二分法、三分法
//http://acm.hdu.edu.cn/showproblem.php?pid=2675//Equation Again/*题目等价于 x^y = y^xln(x)/x = ln(y)/y所以 x和y是f(z) = ln(z)/z函数取某个值时的不同的z的两个自变量再打一下表 汇出f(z)的图像显然x=y(y>=e)是它的一个解,由图像还有一个是在1和e之间
2009-03-10 23:00:00
1286
3
原创 自动机理论(AC自动机)
/*程序说明:多模式串匹配的AC自动机算法此题通过hdu 2222自动机算法可以参考《柔性字符串匹配》里的相应章节,讲的很清楚*/#include #include const int MAXQ = 500000+10;const int MAXN = 1000000+10;const int MAXK = 26; //自动机里字符集的大小
2009-03-10 22:59:00
4203
2
原创 后缀数组
/* 4022402 B06350214 2774 Accepted 4500K 563MS G++ 2632B 2008-09-05 15:03:32 *///参考国家队的一篇论文by 许智磊#include #include #include #include using namespace std;#define Min(a,b) (a)<(b)?
2009-03-10 21:45:00
941
1
原创 字典树
//此代码摘自zju3181 cover the sring Trie+DP typedef long long ll;struct TrieNode{ TrieNode *sibling[26]; ll cnt;};TrieNode *root;TrieNode *NewTrieNode(){ TrieNode *a = new TrieNo
2009-03-10 21:44:00
456
立足现实 与时俱进:C++ 1991-2006(Evolving a language in and for the real world: C++ 1991-2006)
2010-04-24
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人