[POJ2084]Game of Connections
Time Limit: 1000MS | Memory Limit: 30000K | |
Total Submissions: 7888 | Accepted: 3965 |
Description
And, no two segments are allowed to intersect.
It's still a simple game, isn't it? But after you've written down the 2n numbers, can you tell me in how many different ways can you connect the numbers into pairs? Life is harder, right?
Input
You may assume that 1 <= n <= 100.
Output
Sample Input
2
3
-1
Sample Output
2
5
Source
Thinking
高精度卡特兰数,如果不想写高精度就像我一样打表吧。记得用超长字符串。
PS:卡特兰数第一百项需用恒河沙记(10^57),你考虑考虑什么能存的下。
const a:array[..] of ansistring =
('',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
''
);
var n:longint;
begin
while true do
begin
read(n);
if n=- then halt;
writeln(a[n]);
end;
end.
[POJ2084]Game of Connections的更多相关文章
- POJ2084 Game of Connections 卡特兰数 关于卡特兰数经典的几个问题
Game of Connections Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 9128 Accepted: 44 ...
- POJ2084 Game of Connections(数学,dp)
题目链接. 分析: 简单的 Catalan 数 将x~y编号,设解为 d(x, y), d(x, y) = {d(x+1,i-1)*d(i+1,y)}, 其中 x+1<= i <= y, ...
- nyoj 164&&poj2084 Game of Connections 【卡特兰】
题意:将1~2n个数依照顺时针排列好.用一条线将两个数字连接起来要求:线之间不能有交点.同一个点仅仅同意被连一次. 最后问给出一个n,有多少种方式满足条件. 分析: ans[n]表示n的中的种类数. ...
- (Catalan数 大数) Game of Connections poj2084
Language: Game of Connections Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 8837 Accept ...
- 解决mysql too many connections的问题
由于公司服务器上的创建的项目太多,随之创建的数据库不断地增加,在用navicat链接某一个项目的数据库时会出现too many connections ,从而导致项目连接数据库异常,致使启动失败. 为 ...
- Data source rejected establishment of connection, message from server: "Too many connections"解决办法
异常名称 //数据源拒绝从服务器建立连接.消息:"连接太多" com.MySQL.jdbc.exceptions.jdbc4.MySQLNonTransientConnection ...
- Configure Security Settings for Remote Desktop(RDP) Services Connections
catalogue . Configure Server Authentication and Encryption Levels . Configure Network Level Authenti ...
- 问题解决:psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
错误提示: psql: could not connect to server: No such file or directory Is the server running locally and ...
- Too Many Connections: How to Increase the MySQL Connection Count To Avoid This Problem
1.问题描述 在启动使用mysql数据库的项目时,遇到一个报错,如下: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConn ...
随机推荐
- ajax、json一些整理(3)
写上面那些都是因为对ajax不熟悉 从w3c抄写JS原生ajax的东西补充一些基础 XMLHttpRequest 是 AJAX 的基础. XMLHttpRequest 对象 所有现代浏览器均支持 XM ...
- [C#]判断是否是合法的IP4,IP6地址
判断一个字符串如果没有端口的话,利用IPAddress.TryParse很好判断,那么有端口怎么判断呢,正则表达式?还是其他方式? 关键代码: /// <summary> /// 判断是否 ...
- google map android api v2
我在这主要列举几个需要注意的问题: 1.需要注意使用的api版本的问题,例如google map android api v1就和v2差别很大,包括申请key方面,所以在搜索资料的时候一定注意版本问题 ...
- NOSQL之【Redis学习:配置说明】
# yes:后台运行:no:不是后台运行(老版本默认) daemonize yes # redis的进程文件 pidfile /var/run/redis.pid # 端口 port # bind_a ...
- 2016041601 - linux上安装maven
在linux系统中安装maven,个人目前使用ubuntu15.1系统. 要想使用maven,前提条件必须配置好java. 1.检查java信息. 命令:echo $JAVA_HOME 和java - ...
- stm32类型cl、vl、xl、ld、md、hd的含义
- startup_stm32f10x_ld_vl.s: for STM32 Low density Value line devices - startup_stm32f10x_ld.s: for ...
- qt 5 小练习 创建无边框界面
我们大家都知道QT5 自带的界面不是那么美观,并且每个软件我们都发现他们的边框是自定义的,所以我决定写一篇这样的博文,也许已经有许许多多篇大牛写的论文了,但我还是想写一篇记录自己的学习QT的历程 首先 ...
- 视图--bai
/*视图的必要性 create view population_all_view as select xxxx 详细信息 from qgck where rownum<500 -- sql语句不 ...
- ACM-进阶之路
ACM进阶计划 ACM队不是为了一场比赛而存在的,为的是队员的整体提高. 大学期间,ACM队队员必须要学好的课程有: l C/C++两种语言 l 高等数学 l 线性代数 l 数据结构 l 离散数学 l ...
- this、call和apply
this call apply this 和其他语言不同,JavaScript的this总是指向一个对象,而具体指向哪个对象是在运行时基于函数的执行环境动态绑定的,而非函数被声明时的环境. this的 ...