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 ...
随机推荐
- eclipse添加hadoop开发插件
在开发hadoop的时候去查找了一下eclipse marketplace是没有找到hadoop的插件,上网又找了一下发现原来hadoop中其实是带有这样的插件的, 其实很简单只要将这个插件复制到ec ...
- Apache 日志分析(二)
01.查看IP cat access_log | awk ‘{print $1}’ 02.对IP排序 cat access_log | awk ‘{print $1}’ | sort 03.打 ...
- #316 div.2
主要记录下被坑的B.果然大晚上脑子就是不知道在干嘛,明明都测到 “1 1” 这个样例错了都没发现直接给放过去了,白白让人hack爽了... 题意就是给你一个数m,让你从1~n个数中选一个作a,使1~n ...
- XML语言:可扩展的标记语言;
作用:1. 解决跨语言的数据交换,C#与Javascript 语言的数据交换:. 2.XML:用于数据的存储以及传输:1.新建方法: 在解决方案资源管理器----选中网站名---右击添加新建项---- ...
- oracle查看允许的最大连接数和当前连接数等信息
目前总结的语句,在查看数据的连接情况很有用 ,写完程序一边测试代码一边查看数据库连接的释放情况有助于分析优化出一个健壮的系统程序来. 1.Sql代码1.select count(*) from v$p ...
- Table of Contents - Quartz Scheduler
Getting Started Hello World Integration with Spring Quartz Scheduler Developer Guide Usage of JobDat ...
- Mousetrap - Keyboard shortcuts in Javascript
Mousetrap is a simple library for handling keyboard shortcuts in Javascript. It is around 2kb minifi ...
- js完美解决IE6不支持position:fixed的bug
详细内容请点击 <!DOCTYPE html><html><head><meta http-equiv="Content-Type" co ...
- 【转】使用SharpZipLib实现zip压缩
使用国外开源加压解压库ICSharpCode.SharpZipLib实现加压,该库的官方网站为 http://www.icsharpcode.net/OpenSource/SharpZipLib/Do ...
- Part 57 to 58 Why should you override ToString and Equal Method
Part 57 Why should you override ToString Method sometimes you can override ToString method like that ...