摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1198 1 #include 2 #include 3 #include 4 #define maxn 4000 5 using namespace std; 6 7 int b[11][4]={{1,0,... 阅读全文
posted @ 2014-04-13 21:43 null1019 阅读(115) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1162 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define maxn 200 7 using namespace std; 8... 阅读全文
posted @ 2014-04-13 20:26 null1019 阅读(108) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1102 1 #include 2 #include 3 #include 4 #define maxn 1001 5 using namespace std; 6 const int inf=1<<30; 7... 阅读全文
posted @ 2014-04-13 19:35 null1019 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 类似于素数打表。 1 #include 2 #include 3 #include 4 #define maxn 1000100 5 using namespace std; 6 7 int f[maxn]; 8 9 void inti()10 {11 int num=0;12 ... 阅读全文
posted @ 2014-04-13 18:15 null1019 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 这道题的知识点第一次听说 ,就是应用斯特林数。题目的意思是给你房间数N,和最多能破门的个数,让你求能全部把房间打开的概率!a[i][j]=a[i-1][j-1]+(i-1)*a[i-1][j]; 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 long long f[30],a[30][30]; 8 9 void inti()10 {11 f[1]=1;12 f[0]=1;13 for(int i=2; i<=20; i++)14 {15 f... 阅读全文
posted @ 2014-04-13 10:30 null1019 阅读(233) 评论(0) 推荐(0) 编辑