上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 25 下一页

2011年8月1日

HDU 1032 水题

摘要: /** Author:lonelycatcher* problem:heu 1032* type:纯水题*/#include <iostream>#include<stdio.h>#include<string.h>#include<string.h>using namespace std;int fun(int x){int i=1;while(x!=1){if(x&1){x=3*x+1;}else{x=x>>1;}i++;}return i;}int main(){setbuf(stdout,NULL);int left, 阅读全文

posted @ 2011-08-01 08:14 lonelycatcher 阅读(218) 评论(0) 推荐(0) 编辑

HDU1031 排序题

摘要: /** Author:lonelycatcher* Problem:HDU 1031* Type:排序水题*/#include<iostream>#include<stdio.h>#include<math.h>#include<algorithm>using namespace std;int N,M,K;struct node{double value;int index;};node nodes[1000000];int cmp1(const void* a,const void* b){node c=*(node*)a;node d=*( 阅读全文

posted @ 2011-08-01 08:12 lonelycatcher 阅读(481) 评论(0) 推荐(0) 编辑

2011年7月30日

母函数

摘要: 转自:http://www.wutianqi.com/?p=596最近更新:2011.4.31.鉴于文章图片和排版的问题,对文章进行了重新编辑。2.看见网上很多朋友在转载时不尊重别人的劳动成果,任意删除文章里关于作者的信息,希望大家在转载时保留文章所有信息,遵守版权规定。前段时间写了一篇《背包之01背包、完全背包、多重背包详解》,看到支持的人很多,我不是大牛,只是一个和大家一样学习的人,写这些文章的目的只是为了一是希望让大家学的轻松,二是让自己复习起来更方便。(以下内容部分引至杭电ACM课件和维基百科)在数学中,某个序列的母函数是一种形式幂级数,其每一项的系数可以提供关于这个序列的信息。使用母 阅读全文

posted @ 2011-07-30 16:01 lonelycatcher 阅读(549) 评论(0) 推荐(0) 编辑

HDU 1028 整数划分 母函数

摘要: 这是一道整数划分的题目,用到的算法思想是母函数,当然还有其他的比如递推,DP可以用来解决这道题,关于母函数的思想可以参考http://www.wutianqi.com/?p=596/** Author:lonelycatcher* problem:hdu 1028* Type: 母函数,拆分数,整数划分*/#include<stdio.h>#include<string.h>#include<cstdlib>#include <iostream>using namespace std;int N;__int64 c1[125];__int64 c 阅读全文

posted @ 2011-07-30 15:59 lonelycatcher 阅读(1175) 评论(0) 推荐(0) 编辑

2011年7月29日

HDU 1027 全排列

摘要: 这是一道排列的题目,北大的程序设计书里面有这道题,讲的挺细的,可以去看看,两种方法/** Author:lonelycatcher* Problem:HDU 1027* Type:全排列*///方法一:/*#include<stdio.h>#include<string.h>#include<cstdlib>#include<algorithm>using namespace std;int n,m;int sequence[1010];int main(){setbuf(stdout,NULL);int i,j,k;while(scanf(&q 阅读全文

posted @ 2011-07-29 12:24 lonelycatcher 阅读(1160) 评论(1) 推荐(0) 编辑

上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 25 下一页

导航