HDU 1465 第六周L题
Description
不幸的是,这种小概率事件又发生了,而且就在我们身边: 事情是这样的――HDU有个网名叫做8006的男性同学,结交网友无数,最近该同学玩起了浪漫,同时给n个网友每人写了一封信,这都没什么,要命的是,他竟然把所有的信都装错了信封!注意了,是全部装错哟!
现在的问题是:请大家帮可怜的8006同学计算一下,一共有多少种可能的错误方式呢?
Input
Output
Sample Input
3
Sample Output
2
#include <stdio.h>
long long a[];
int main()
{
int n;
a[]=;
a[]=;
for(int i=; i<=; i++)
a[i]=(i-)*(a[i-]+a[i-]);
while(scanf("%d",&n)==)
{
printf("%lld\n",a[n]);
}
return ;
}
HDU 1465 第六周L题的更多相关文章
- hdu 4548 第六周H题(美素数)
第六周H题 - 数论,晒素数 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u De ...
- HDU1465 第六周L题(错排组合数)
L - 计数,排列 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Descrip ...
- HDU 2669 第六周 I题
Description The Sky is Sprite. The Birds is Fly in the Sky. The Wind is Wonderful. Blew Throw the ...
- HDU 1405 第六周 J题
Description Tomorrow is contest day, Are you all ready? We have been training for 45 days, and all ...
- 程序设计入门—Java语言 第六周编程题 1 单词长度(4分)
第六周编程题 依照学术诚信条款,我保证此作业是本人独立完成的. 1 单词长度(4分) 题目内容: 你的程序要读入一行文本,其中以空格分隔为若干个单词,以'.'结束.你要输出这行文本中每个单词的长度.这 ...
- Codeforces 559A 第六周 O题
Description Gerald got a very curious hexagon for his birthday. The boy found out that all the angle ...
- 集训第六周 O题
Description Gerald got a very curious hexagon for his birthday. The boy found out that all the angle ...
- 集训第六周 M题
Description During the early stages of the Manhattan Project, the dangers of the new radioctive ma ...
- 第六周 E题 期望.....
Description Given a dice with n sides, you have to find the expected number of times you have to thr ...
随机推荐
- Django升级1.6之后出现“Bad Request (400)”错误的解决方案
Django从1.4升级到1.6之后发现之前的网站都无法访问了,会出现“Bad Request (400)”的错误,搜了半天终于找到了解决办法. 解决方法很简单: 在settings.py里面添加: ...
- Meta也很强
<!--http-equiv 必要属性--> <meta http-equiv="Content-Type" content="text/html; c ...
- MongoDB - MongoDB CRUD Operations, Query Documents
Query Method MongoDB provides the db.collection.find() method to read documents from a collection. T ...
- File.Create创建文件后,需要释放资源
if (!File.Exists(SavePath)) { File.Create(SavePath).Close(); }
- eBay 开发流程
1[记录]注册成为eBay开发者(eBay Developers Program)+创建Sanbox Key和Production Key http://www.crifan.com/register ...
- iOS - UIView操作(SWift)
1. UIView 视图的渐变填充 override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after ...
- Cocos2d-JS中的Sprite精灵类
精灵类是cc.Sprite,它的类图如下图所示.cc.Sprite类直接继承了cc.Node类,具有cc.Node基本特征. 创建Sprite精灵对象 创建精灵对象可以使用构造函数实现,它们接受相同的 ...
- Xcode6 模拟器不显示键盘
在学习加法计算器时,程序运行后发现点击模拟器上的输入框时有时候键盘可以弹出来,有时候又弹不出来. 网上查询结果只需要在模拟器的菜单中找到hardware -> keyboard -> 取消 ...
- 如何系统地学习Node.js?
转载自知乎:http://www.zhihu.com/question/21567720 ------------------------------------------------------- ...
- jquery动态移除/增加onclick属性详解
本文章给大家介绍利用jquery的removeAttr与attr事件来给a标签增加与删除onclick事件的具体操作方法,有需要了解的朋友可参考. 要实现效果:点击链接先去掉onclick属性,3秒 ...