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 ...
随机推荐
- Java中Integer的最大值和最小值
从JDK1.0开始,Integer中就定义了MIN_VALUE和MAX-VALUE两个常量: /** * A constant holding the minimum value an {@code ...
- VS2013 支持python和nodejs
一.在VS2013中,安装python的支持 1. http://pytools.codeplex.com/下载插件 2. https://www.python.org/download/下载Pyth ...
- sql server小技巧-自动添加时间与主键自增长
在敲机房收费系统的时候,遇到添加时间的时候总是通过vb端调用当前时间再添到sql server中,期间还有时因为添加时间格式的不统一导致一些小问题,现在才知道原来是自己孤陋寡闻,sql server ...
- extjs 简单入门
中文网站:http://extjs.org.cn/ 英文网站:http://www.sencha.com/products/extjs/ 1.简介 extJS是一种主要用于创建前端用户界面,是一个基本 ...
- Hive编程(影印版)
<Hive编程(影印版)> 基本信息 原书名:Programming Hive 作者: Edward Capriolo Dean Wampler Jason Rutherglen 出版社: ...
- http请求数据
/// <summary> /// http请求post数据 /// </summary> /// <param name=&q ...
- python pdb调试
在交互环境中通常使用pdb.run来调试: import pdb def pdb_test(arg): for i in range(arg): print(i) return arg pdb.run ...
- 你有没有试过“闭上眼”使用:京东、滴滴、QQ、支付宝?
正在看这篇文章的同学,也许是幸运的. 互联网的发展,让我们的生活越来越便利,但这个“我们”,也许并不包括那些残障人士.正常人眼里来说再简单不过的页面操作,对于盲人来说都是不可攀越的高墙.换句话说,越行 ...
- MVC 菜鸟学习记录2
自定义Html.Helper扩展方法 在Models文件夹下新建一个静态类,取名为:MyHtmlHelper.cs 将MyHtmlHelper设置为static,并写入以下的一个静态方法 public ...
- MVC基础(很基础很基础~~~)
最近工作比较不忙,准备学习一些东西,作为一个菜鸟,不断学习新东西(我不会的东西)充实自己真的很重要,所以整理一下基础的mvc知识,以备不时之需.呵呵~~ 首先感谢原文作者:QLeelulu的文章htt ...