题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1131

思路:R(x)=h(x)*n!=C(n,2*n)*n!=A(n+2,n*2);

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
const int maxn = ;
int i,j,n,a[maxn+];
int main(void)
{
while(~scanf("%d",&n)&&n)
{
memset(a,,sizeof(a));
a[]=;
for(i=n+;i<=*n;i++)
{
for(j=;j<;j++) a[j]*=i;
for(j=;j<;j++)
{
if(a[j]>=)
{
a[j+]+=a[j]/;
a[j]%=;
}
}
}
for(i=;i>&&a[i]==;i--) ;
for(;i>;i--) printf("%d",a[i]);
printf("%d\n",a[i]);
}
return ;
}

hdu-1131(卡特兰数+大数)的更多相关文章

  1. hdu 1130,hdu 1131(卡特兰数,大数)

    How Many Trees? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)T ...

  2. 2014年百度之星程序设计大赛 - 初赛(第一轮) hdu Grids (卡特兰数 大数除法取余 扩展gcd)

    题目链接 分析:打表以后就能发现时卡特兰数, 但是有除法取余. f[i] = f[i-1]*(4*i - 2)/(i+1); 看了一下网上的题解,照着题解写了下面的代码,不过还是不明白,为什么用扩展g ...

  3. HDU 1134 卡特兰数 大数乘法除法

    Problem Description This is a small but ancient game. You are supposed to write down the numbers 1, ...

  4. HDU 1134 Game of Connections(卡特兰数+大数模板)

    题目代号:HDU 1134 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1134 Game of Connections Time Limit: 20 ...

  5. HDOJ/HDU 1133 Buy the Ticket(数论~卡特兰数~大数~)

    Problem Description The "Harry Potter and the Goblet of Fire" will be on show in the next ...

  6. Buy the Ticket HDU 1133 卡特兰数应用+Java大数

    Problem Description The "Harry Potter and the Goblet of Fire" will be on show in the next ...

  7. 【hdoj_1133】Buy the Ticket(卡特兰数+大数)

    题目:http://acm.hdu.edu.cn/showproblem.php?pid=1133 题目的意思是,m个人只有50元钱,n个人只有100元整钱,票价50元/人.现在售票厅没钱,只有50元 ...

  8. Train Problem II(卡特兰数+大数乘除)

    Train Problem II Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) ...

  9. HDU 4828 (卡特兰数+逆)

    HDU 4828 Grids 思路:能够转化为卡特兰数,先把前n个人标为0.后n个人标为1.然后去全排列,全排列的数列.假设每一个1的前面相应的0大于等于1,那么就是满足的序列,假设把0看成入栈,1看 ...

  10. hdu-1130(卡特兰数+大数乘法,除法模板)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1130 卡特兰数:https://blog.csdn.net/qq_33266889/article/d ...

随机推荐

  1. 使用IDEA开发Activiti工作流

    首先安装cativiti插件,安装成功后重启IDEA 然后在文件夹右键选择 然后就可以画图了,但是画图之后,没有连接图标怎么办呢 把鼠标放在开头的那个图标上,此时光标的形状改变了. 拖到另一个上面,连 ...

  2. iphone splash screen

    https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articl ...

  3. mongodb基础学习12-分组group操作

    group可以实现常用的统计操作,如求最大值,最小值,求和 其中reduce是最关键的操作,是对每一条记录的具体操作 下面来看例子: 分组count求和 部分结果 下面的加了个查询条件,即查询价格大于 ...

  4. Apache Hive 执行HQL语句报错 ( 10G )

    # 故障描述: hive > , ) as uuid, count(distinct(request_body["uuid"])) as count from log_bft ...

  5. Eclipse中Ctrl+Shift+f快捷键无效的解决方式

    某天突然发现idea非常重要的快捷键ctrl+shift+f无效了,网上搜了很多都说是qq快捷键冲突,但是找了下qq快捷键却没有解决,现在给大家一个解决快捷键冲突的思路: 1.查看QQ快捷键--> ...

  6. VCL编写笔记整理

    unit hzqEdit1; interface uses  SysUtils, Classes, Controls, StdCtrls; type  TEditDataType = (dtpStri ...

  7. hmm 软件的使用

    1)使用HMM模型搜索序列数据库(以青蟹蛋白库为例,简写为qingxie.pep),同源参考序列(query.fas) hmmbuild: 用多重比对序列构建HMM模型:hmmsearch: 使用HM ...

  8. Spring @Configuration

    下面是一个典型的spring配置文件(application-config.xml): <beans> <bean id="orderService" class ...

  9. HTML的基础知识

    1.什么是HTML? html是一种,用来描述网页的一种语言,指的是一种超文本编辑语言,他不是一种编程的语言,而是一种标记的语言,包含:静态HTML和动态的HTML: 2.学习推荐的网站: http: ...

  10. Unicode、UTF8与UTF16

    1 概念 Unicode是国际组织制定的可以容纳世界上所有文字和符号的字符编码方案 UTF是“Unicode Transformation Format”的缩写,可以翻译成Unicode字符集转换格式 ...