题目大意:这是一道简单排列组合题 。简单说下题意:n件物品,把这n件物品放到不是原来的位置,问所有的方案数。所有的位置都没有变。题目解析:按照高中的方法,很快得到一个递推公式:f [n]= (n-1)*( f [n-1] + f [n-2] ) 。这个公式也不难理解,可以采取这样的策咯:一件物品一件...
分类:
其他好文 时间:
2015-07-29 21:01:36
阅读次数:
104
Today I have finished the development of free-WiFi sdk, it is a trouble work. The principle of the sdk is use the Apple's private api to scan the lis....
分类:
其他好文 时间:
2015-07-22 22:17:23
阅读次数:
144
http://acm.hdu.edu.cn/showproblem.php?pid=4123
Problem Description
Bob wants to hold a race to encourage people to do sports. He has got trouble in choosing the route. There are N houses and N...
分类:
其他好文 时间:
2015-07-17 22:43:59
阅读次数:
209
日期问题解决方法2015/3/3SSH登录/WinSCP连接太慢在/etc/ssh/sshd_config中添加一行:UseDNSno正则表达式反向预查(?:)(?!)/(?=)/(?Mysql如何为root配置远程访问?GRANTALLPRIVILEGESON*.*TOroot@'%'ID...
分类:
其他好文 时间:
2015-07-15 16:35:03
阅读次数:
198
3942 - Remember the Word
Neal is very curious about combinatorial problems, and now here comes a problem about words. Knowing that Ray has a photographic memory and this may not trouble him, Neal...
分类:
其他好文 时间:
2015-07-14 18:07:32
阅读次数:
156
Verbose Logging Will Disturb Your SleepJohannes BrodwallWHEN I ENCOUNTER A SYSTEM that has already been in development or pro- duction for a while, the first sign of real trouble is always a dirty log....
分类:
其他好文 时间:
2015-07-13 10:22:17
阅读次数:
115
在Swift中@selector 直接用 "methodName" 就可以了,如果后面有参数记得加上冒号 "methodName:"
“does not implement methodSignatureForSelector: -- trouble ahead”
“does not implement doesNotRecognizeSelector: -- abort”
如果...
分类:
编程语言 时间:
2015-07-10 19:05:24
阅读次数:
154
原文 Jasper White is one of those rare people who believes in ancient myths. He has just bought a new house in the city, but ever since he moved in, he has had trouble with cars and their owners. W...
分类:
其他好文 时间:
2015-07-09 23:00:51
阅读次数:
377
题目连接http://acm.hdu.edu.cn/showproblem.php?pid=2952Counting SheepDescriptionA while ago I had trouble sleeping. I used to lie awake, staring at the cei...
分类:
其他好文 时间:
2015-07-01 23:28:53
阅读次数:
257
【题目链接】:click here~~【题目大意】:计算x1^m+x2^m+..xn^m(1 1 )
【解题思路】:
快速幂取模
代码:
#include
#define LL long long
using namespace std;
const LL mod=(LL)1e9+7;
LL pow_mod(LL a,LL p,LL n)
{
if(p==0) return...
分类:
其他好文 时间:
2015-06-29 00:37:24
阅读次数:
173