## 量子流逝

-----------------------------I Will Fight For My Dream

# SGU 130 Circle

sgu上搞这种题目估计是用来增长自信心的。。。否则哥真要被sgu虐死了！！擦！！

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<set>
#include<cmath>
#include<cassert>
#include<cstring>
#include<iomanip>
using namespace std;

#ifdef _WIN32
#define i64 __int64
#define out64 "%I64d\n"
#define in64 "%I64d"
#else
#define i64 long long
#define out64 "%lld\n"
#define in64 "%lld"
#endif

#define FOR(i,a,b)      for( int i = (a) ; i <= (b) ; i ++)
#define FF(i,a)         for( int i = 0 ; i < (a) ; i ++)
#define FFD(i,a)        for( int i = (a)-1 ; i >= 0 ; i --)
#define S64(a)          scanf(in64,&a)
#define SS(a)           scanf("%d",&a)
#define LL(a)           ((a)<<1)
#define RR(a)           (((a)<<1)+1)
#define SZ(a)           ((int)a.size())
#define PP(n,m,a)       puts("---");FF(i,n){FF(j,m)cout << a[i][j] << ' ';puts("");}
#define pb              push_back
#define CL(Q)           while(!Q.empty())Q.pop()
#define MM(name,what)   memset(name,what,sizeof(name))
#define write           freopen("out.txt","w",stdout)

const int inf = 0x3f3f3f3f;
const i64 inf64 = 0x3f3f3f3f3f3f3f3fLL;
const double oo = 10e9;
const double eps = 10e-10;
const double pi = acos(-1.0);
const int maxn = 33;

i64 dp[33];
int n;

void dpstart()
{
MM(dp,0);
dp[0]=1;
dp[1]=1;
dp[2]=2;
int now,to;
for(int k=3;k<maxn;k++)
{
for(int i=1;i<=k;i++)
{
now=i-1;
to=k-i;
dp[k]+=dp[now]*dp[to];
}
}
return ;
}

int main()
{
dpstart();
while(cin>>n)
{
cout<<dp[n]<<" "<<n+1<<endl;
}
return 0;
}


#### SGU 130 Circle 卡特兰数

2013-12-16 23:35:10

#### sgu 130 Circle

2012-11-01 14:58:04

#### SGU 130 Circle（卡特兰数）

2016-04-15 11:17:22

#### Sgu 130 Catalan数

2016-09-22 19:28:20

#### SGU 130 - 139 解题报告

2016-07-11 21:29:09

#### 史上最全的SGU题目分类

2014-02-13 23:39:38

#### [SGU]130. Circle

2012-10-31 18:13:59

#### SGU AC人数排序 可以用来确定刷题顺序

2014-12-03 13:23:01

#### 【扩展欧几里得+解不等式】sgu106The equation

2015-09-10 16:50:32

#### SGU

2015-05-23 22:51:43