码迷,mamicode.com
首页 >  
搜索关键字:lightoj 1214    ( 714个结果
lightoj 1102 - Problem Makes Problem (组合+逆元)
题意:求n有顺序的划分为k个数的方案数.思路:显然这个就是一个组合公式,隔板法。可以把问题转化为x1+x2+…..xk = n 这个多元一次方程上。然后这个解就是C(n+k-1,k-1) 这道题n,k范围都是1e6。 我们可以预处理出阶乘,然后求对应的组合数,注意这里需要取Mod,用下逆元就好啦.参考code:/* #pragma warning (disable: 4786) #pragm...
分类:其他好文   时间:2015-08-27 23:08:49    阅读次数:138
lightoj 1095 - Arrange the Numbers (错排数)
题意:求n个数的排列,前m个中有k个在自己的位置上的方法数。思路:设D[n]为n个元素的错排数. 于是我们有D[1] = 0 D[2] = 1; D[n] = (D[n-1] + D[n-2]) * (i-1) 考虑问题本身,我们首先从前m个数选k个数不动.即C(m,k)。对于没有选的前m中的m-k个数肯定是参与了错排,而后面n-m个数中参加错排的个数不定,所以我们枚举一个后面n-m个数中选出...
分类:其他好文   时间:2015-08-27 23:03:48    阅读次数:685
LightOJ 1403 - Air Raid【二分匹配】
题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1403代码:#include #include #include #include #include #include #include <sstre...
分类:其他好文   时间:2015-08-27 07:15:08    阅读次数:183
LightOJ 1184 - Marriage Media 【二分图最大匹配】
题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1184根据一些要求建图即可代码:#include #include #include #include #include #include #incl...
分类:其他好文   时间:2015-08-27 07:13:00    阅读次数:184
LightOJ 1201 - A Perfect Murder【二分图最大独立集】
链接:http://www.lightoj.com/volume_showproblem.php?problem=1201最大独立集= 顶点数- 最大匹配代码:#include #include #include #include #include #include #...
分类:其他好文   时间:2015-08-26 22:28:06    阅读次数:200
LightOJ 1149 - Factors and Multiples【二分图最大匹配】
题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1149代码:#include #include #include #include #include #include #include <sstre...
分类:其他好文   时间:2015-08-26 20:06:37    阅读次数:170
LightOJ 1104 Birthday Paradox
DescriptionSometimes some mathematical results are hard to believe. One of the common problems is the birthday paradox. Suppose you are in a party whe...
分类:其他好文   时间:2015-08-21 23:09:05    阅读次数:158
lightOJ 1317 Throwing Balls into the Baskets
lightOJ 1317 Throwing Balls into the Baskets(期望)解题报告题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=88890#problem/A题目:DescriptionYou probab...
分类:Windows程序   时间:2015-08-21 23:00:59    阅读次数:238
LightOJ 1317 第六周比赛A题
A -ATime Limit:2000MSMemory Limit:32768KB64bit IO Format:%lld & %lluDescriptionYou probably have played the game "Throwing Balls into the Basket". It ...
分类:其他好文   时间:2015-08-21 21:26:01    阅读次数:167
LightOJ - 1317 Throwing Balls into the Baskets
DescriptionYou probably have played the game "Throwing Balls into the Basket". It is a simple game. You have to throw a ball into a basket from a cert...
分类:Windows程序   时间:2015-08-21 21:05:28    阅读次数:149
714条   上一页 1 ... 51 52 53 54 55 ... 72 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!