摘要: 题目:http://acm.hit.edu.cn/hoj/problem/view?id=1402整数划分问题Submitted: 886,Accepted: 374整数划分是一个经典的问题。希望这道题会对你的组合数学的解题能力有所帮助。Input每组输入是两个整数n和k。(1 <= n <= 50, 1 <= k <= n)Output对于每组输入,请输出六行。第一行: 将n划分成若干正整数之和的划分数。第二行: 将n划分成k个正整数之和的划分数。第三行: 将n划分成最大数不超过k的划分数。第四行: 将n划分成若干奇正整数之和的划分数。第五行: 将n划分成若干不同整数 阅读全文
posted @ 2013-05-14 20:08 Roly Yu 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=3374最小表示法:http://tobyaa.blog.163.com/blog/static/30248591201261604349913/#include <stdio.h>#include <string.h>#include <iostream>#include <algorithm>using namespace std;const int maxn = 1000005;char str[maxn];int next[maxn];void ge 阅读全文
posted @ 2013-05-14 18:36 Roly Yu 阅读(214) 评论(0) 推荐(0) 编辑
摘要: /* 对于小数据用这dfs,大数据就用递推的思想。*/#include <iostream>#include <stdio.h>#include <string>#include <string.h>#include <algorithm>#include <math.h>#include <queue>#include <map>#include <stack>#include <vector>using namespace std ;const int maxn = 20 阅读全文
posted @ 2013-05-14 15:13 Roly Yu 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 题目:http://codeforces.com/contest/304/problem/B#include <iostream>#include <stdio.h>#include <string>#include <string.h>#include <algorithm>#include <math.h>#include <fstream>#include <vector>#include <map>#include <queue>#include <stack& 阅读全文
posted @ 2013-05-14 09:11 Roly Yu 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 题目:http://acm.fzu.edu.cn/problem.php?pid=1926#include <iostream>#include <stdio.h>#include <string>#include <string.h>#include <algorithm>#include <stdlib.h>#include <math.h>#include <vector>#include <map>using namespace std;const int maxn = 1005 阅读全文
posted @ 2013-05-11 22:05 Roly Yu 阅读(189) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <algorithm>#include <stdio.h>#include <string>#include <string.h>#include <stdlib.h>#include <math.h>#include <vector>#include <map>#include <queue>#include <stack>#include <set>using namespace std ;c 阅读全文
posted @ 2013-05-10 13:30 Roly Yu 阅读(172) 评论(0) 推荐(0) 编辑
摘要: http://acm.neu.edu.cn/hustoj/problem.php?id=1262#include <iostream>#include <stdio.h>#include <string>#include <string.h>#include <algorithm>#include <math.h>#include <fstream>#include <vector>#include <map>#include <queue>#include <stac 阅读全文
posted @ 2013-05-09 10:59 Roly Yu 阅读(192) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <stdio.h>#include <string>#include <string.h>#include <algorithm>#include <math.h>#include <fstream>#include <vector>#include <map>#include <queue>#include <stack>#include <math.h>#include <stdlib. 阅读全文
posted @ 2013-05-07 21:47 Roly Yu 阅读(200) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <stdio.h>#include <string>#include <string.h>#include <algorithm>#include <math.h>#include <fstream>#include <vector>#include <map>#include <queue>#include <stack>#include <math.h>#include <stdlib. 阅读全文
posted @ 2013-05-07 15:16 Roly Yu 阅读(180) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <stdio.h>#include <string>#include <string.h>#include <algorithm>#include <math.h>#include <fstream>#include <vector>#include <map>#include <queue>#include <stack>#include <math.h>#include <stdlib. 阅读全文
posted @ 2013-05-07 09:21 Roly Yu 阅读(152) 评论(0) 推荐(0) 编辑