上一页 1 ··· 9 10 11 12 13 14 15 下一页
摘要: 转自别人的博客。这里记录一下这题是定义如下的一个数:S(0, 0) = 1; S(n, 0) = 0 for n > 0;S(0, m) = 0 for m > 0;S(n, m) = m S(n - 1, m) + S(n - 1, m - 1), for n, m > 0.也就是题中所说的把一个... 阅读全文
posted @ 2014-10-02 20:10 Commence 阅读(154) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #inclu... 阅读全文
posted @ 2014-09-27 17:11 Commence 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 题意 :lucky cat里有翻译。英文也比较好懂。很容易发现有周期然后就拍就好了注意每组数据后边都有空行 包括最后一组。一开始以为最后一组没有空行。唉。。#include #include #include #include #include #include #include #include ... 阅读全文
posted @ 2014-09-27 14:43 Commence 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 感觉这个一定要记下来涨教训啊。一开始找规律找错了。判断超麻烦还各种WA。浪费N个小时啊。。人家几行就A了。太弱,#include #include #include #include #include #include #include #include #include #include #inc... 阅读全文
posted @ 2014-09-26 19:48 Commence 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 真心没发现规律。感觉挺像CF一些锻炼思维的题看了这里http://hi.baidu.com/knowledgetime/item/87d13b1f12290a53f1090ea7#include #include #include #include #include #include #includ... 阅读全文
posted @ 2014-09-25 23:46 Commence 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 直接模拟就好。#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #incl... 阅读全文
posted @ 2014-09-25 19:39 Commence 阅读(361) 评论(0) 推荐(0) 编辑
摘要: dp[i][j][m][n][s]表示最初选择j个i号颜色大理石。当前选择n个m号颜色大理石。剩余大理石状态(8进制数状压表示)最开始没看出状压。。sad#include #include #include #include #include #include #include #include #... 阅读全文
posted @ 2014-09-25 13:44 Commence 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 题意就略了。刚一看被数据吓住了。看到字符要求严格递增。那么如果字串长大于26那必然方案数目为0;同时1+2+3....+24+25+26=351如果大于这个数也是不可能的令dp[i][j][k]表示第i位为第j个字符和为K时的方案数目那么 dp[i][j][k]=sum(dp[i-1][m][k-t... 阅读全文
posted @ 2014-09-24 18:30 Commence 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 直接看代码就OK。思路比较简单。就是注意概率要在转移过程中算出来。不能算成成立的方案书除以总方案数(POJ的这道题可以这么干。数据很水么。另外POJ要用%.5f,%.5lf 会WA。)#include #include #include #include #include #include #i... 阅读全文
posted @ 2014-09-23 18:57 Commence 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 题意 把数字T分成N个数的和,保证这N个数中最小的数大于P。求方案数目另f[i][j]表示把i分成j个数的和的方案数f[i][j]=f[i][j-1]+f[i-1][j-1]+f[i-2][j-1]+...f[0][j-1];f[i-1][j]=f[i-1][j-1]+f[i-2][j-1]+...... 阅读全文
posted @ 2014-09-20 16:41 Commence 阅读(155) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 下一页