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 ...
随机推荐
- Android-Activity生命周期从onStart直接到onStop
一般应用场景中,onStart执行后都是要执行onResume,但是如果在onStart中调用了finish,会直接执行onStop.
- PHP将解析xml变为数组方法
最近想要做一个插件机制,需要用到xml,在解析xml时候需要转换为数组,特意记录一个此种解析方式 xml文件 <?xml version="1.0" encoding=&qu ...
- hdu1331 按着题目的公式直接写
#include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #d ...
- 【BUG】---ionic tab-demo项目在modal页跳转URL改变页面不刷新,手动刷新后显示空白
问题描述: 项目是基于ionic tab的demo,在modal上访问其他页面,地址栏变化了,但是页面不动没刷新,自己手动刷新呢,还是空白,可是访问的页面时有内容的啊 错误: 我的路由配置 .stat ...
- 7款经典炫酷的HTML5/jQuery动画应用示例及源码
jQuery是一款普遍受前端开发者欢迎的Javascript框架,但是开发者貌似更关注jQuery开发的插件,海量的jQuery插件让前端开发者非常方便.HTML5的加入让jQuery这个家族更加丰富 ...
- 卸载Linux内置的AMP软件
卸载Linux内置的AMP软件 在安装Linux软件的LAMP环境时,必须有一个前提:必须要完全卸载掉系统内置的AMP软件. 1.卸载httpd软件(Apache) 如果在卸载软件时出现依赖关系,我们 ...
- poj 3669 Meteor Shower
Me ...
- transport
#include<iostream> using namespace std; int transport(int a) { ; ) ; else a=a/; d=; ) { a=a*+; ...
- H.264的一些资料整理
本文转载自 http://blog.csdn.net/ljzcom/article/details/7258978, 如有需要,请移步查看. Technorati 标签: H.264 资料整理 --- ...
- android网络编程
android的网络编程分为2种:基于socket的,和基于http协议的. 基于socket的用法 服务器端: 先启动一个服务器端的socket ServerSocket svr = new ...