摘要: http://blog.csdn.net/monkey0le 阅读全文
posted @ 2013-04-12 16:37 zx雄 阅读(104) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/qiufeihai/ 阅读全文
posted @ 2012-12-23 13:27 zx雄 阅读(142) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/maiyuetong/ 阅读全文
posted @ 2012-12-23 13:26 zx雄 阅读(100) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1520 1 #include <iostream> 2 using namespace std; 3 const int maxn = 6000 + 10; 4 struct Node{ 5 int not;//表示不取时的价值 6 int attend;//表示取时的价值 7 int child; 8 int brother; 9 int father;10 }Tree[maxn];11 int d[maxn];12 int DP[maxn][2];13 int n;... 阅读全文
posted @ 2013-04-24 19:33 zx雄 阅读(143) 评论(0) 推荐(0) 编辑
摘要: http://www.cppblog.com/notonlysuccess/archive/2009/05/11/82614.html 阅读全文
posted @ 2013-04-24 16:08 zx雄 阅读(112) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/scau20110726/archive/2012/12/09/2810654.html 阅读全文
posted @ 2013-04-23 20:27 zx雄 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 基础题:1000、1001、1004、1005、1008、1012、1013、1014、1017、1019、1021、1028、1029、1032、1037、1040、1048、1056、1058、1061、1070、1076、1089、1090、1091、1092、1093、1094、1095、1096、1097、1098、1106、1108、1157、1163、1164、1170、1194、1196、1197、1201、1202、1205、1219、1234、1235、1236、1248、1266、1279、1282、1283、1302、1303、1323、1326、1330、1334、1 阅读全文
posted @ 2013-04-23 14:47 zx雄 阅读(222) 评论(0) 推荐(1) 编辑
摘要: //View Code 1 #include <iostream> 2 #include <algorithm> 3 #include <queue> 4 using namespace std; 5 const int INF = 0x3ffffff; 6 struct Node{ 7 bool operator<(Node a)const{ 8 return time > a.time; 9 } 10 int x; 11 int y; 12 int time; 13 int sudu; 14 int... 阅读全文
posted @ 2013-04-21 21:58 zx雄 阅读(206) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3986题意: 从起点1 到 终点n,删除图中任意一条边求最短路的最坏情况。 n --表示有n个点 m --边数 f t l --f和t之间有一条长度为l的道路 <<<<<<<<<<<<本题有重边>>>>>>>>>>>>>>>>>思路: 先做一次最短路,记录最短路的路径。 删边时枚举最短路上的每条边求删边后的最坏情况。 1 #include 阅读全文
posted @ 2013-04-16 21:09 zx雄 阅读(1143) 评论(0) 推荐(0) 编辑
摘要: 1.求素数:1>普通方法2>素数筛选法3>Mliier_Rabbin素数测试 费马小定理。若 ap-1mod p = 1 ,则p有 3/4的概率是素数。2.求an:例如 a10=a5 * a5 a5 = a2 * a2 * a a2 = a1 * a13.求最大公约数GCD:1> gcd(A,B) = gcd(B,A mod B);__int64 GCD(__int64 a,__int 64 b){ if(b == 0){ return a; } return GCD(b,a mod b);}4.求 d = gcd(a,b) = ax + by且 |x| + |y... 阅读全文
posted @ 2013-04-13 11:01 zx雄 阅读(212) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1075 1 #include <iostream> 2 #include <string> 3 using namespace std; 4 struct Node 5 { 6 char str[20]; 7 int flag; 8 Node *child[26]; 9 }; 10 void NewNode(Node **Q)//注意这里使用了指针的指针 11 { 12 (*Q) = (Node *)malloc(sizeof(Node)); 13 i... 阅读全文
posted @ 2013-04-07 00:38 zx雄 阅读(291) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/ka200812/archive/2011/11/13/2247064.html 阅读全文
posted @ 2013-03-27 10:51 zx雄 阅读(107) 评论(0) 推荐(0) 编辑