摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1085 母函数View Code 1 /*母函数*/ 2 #include<iostream> 3 #include<cstring> 4 using namespace std; 5 const int N=20000; 6 int c1[N],c2[N];//c[i]是x的i次方的系数 7 int num1,num2,num3; 8 void multiply() 9 {10 memset(c2,0,sizeof(c2));11 memset(c1,0,sizeof(c1));12 阅读全文
posted @ 2012-03-29 22:34 keepmoving89 阅读(125) 评论(0) 推荐(0) 编辑
摘要: View Code 1 1001 这个就不用说了吧 2 1002 简单的大数 3 1003 DP经典问题,最大连续子段和 4 1004 简单题 5 1005 找规律(循环点) 6 1006 感觉有点BT的题,我到现在还没过 7 1007 经典问题,最近点对问题,用分治 8 1008 简单题 9 1009 贪心 10 1010 搜索题,剪枝很关键 11 1011 12 1012 简单题 13 1013 简单题(有个小陷阱) 14 1014 简单题 15 1015 可以看作搜索题吧 16 1016 经典的搜索 17 1017 简单数学题 18 1018 简单数学题 19 10... 阅读全文
posted @ 2012-03-29 21:23 keepmoving89 阅读(181) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1162 最小生成树prim算法View Code 1 //*最小生成树,prim算法*/ 2 #include<iostream> 3 #include<cstring> 4 #include<cmath> 5 #include<cfloat>//DBL_MAX 6 #include<iomanip> 7 using namespace std; 8 struct node 9 {10 double x,y;11 };12 node point[10 阅读全文
posted @ 2012-03-29 21:10 keepmoving89 阅读(155) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1142 Dijkstra求最短路径,记录最短路径的条数,cnt记录最短路径的条数出错,不知道错在哪里?View Code 1 #include<iostream> 2 #include<cstring> 3 #include<climits> 4 #include<cmath> 5 using namespace std; 6 #define M 2000000 7 int mat[1008][1008]; 8 bool visited[1008]; 9 int 阅读全文
posted @ 2012-03-29 20:30 keepmoving89 阅读(161) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1213 并查集View Code 1 #include<iostream> 2 #include<algorithm> 3 #include<climits> 4 #include<cstdio> 5 using namespace std; 6 int father[1008]; 7 int t,n,m; 8 void init(int n) 9 {10 for(int i=0;i<=n;i++) father[i]=i;11 }12 int find( 阅读全文
posted @ 2012-03-29 11:20 keepmoving89 阅读(156) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1075 map实现View Code 1 /*map实现,翻译*/ 2 #include<iostream> 3 #include<cstring> 4 #include<cstdlib> 5 #include<map> 6 using namespace std; 7 map<string,string>mat; 8 void print(string s)//找出s对应的英语单词 9 {10 if(mat[s].length()) printf( 阅读全文
posted @ 2012-03-29 09:58 keepmoving89 阅读(145) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1075字典树View Code 1 /*字典树,翻译*/ 2 #include<iostream> 3 #include<cstring> 4 #include<cstdlib> 5 using namespace std; 6 struct node 7 { 8 node* child[26]; 9 char word[12];10 };11 node*root=new node();12 void init()//初始化 13 {14 for(int i=0;i< 阅读全文
posted @ 2012-03-29 08:24 keepmoving89 阅读(228) 评论(0) 推荐(0) 编辑