圆上2K个点连接问题

Time Limit:500MS     Memory Limit:4096KB     64bit IO Format:%I64d & %I64u
 

Description

 

On a circle border there are 2k different points A1, A2, ..., A2k, located contiguously. These points connect k chords so that each of points A1, A2, ..., A2k is the end point of one chord. Chords divide the circle into parts. You have to find N - the number of different ways to connect the points so that the circle is broken into minimal possible amount of parts P.

 

Input

The first line contains the integer k (1 <= k <= 30).

 

Output

The first line should contain two numbers N and P delimited by space.

 

Sample Input

2

Sample Output

2 3

#include<iostream>
#include<sstream>
#include<fstream>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cctype>
#include<cmath>
#include<ctime>
using namespace std;
long long f(int n)
    {
         if(n==0)    return 1;
         else
         {
             long long a=0;

             return a;
         }
      }
int main()
{
    int k;
    long long a[34];
    memset(a,0,sizeof(a));
    a[0]=1;
    a[1]=1;
    a[2]=2;
    for(int i=3;i<33;i++)
             {
                 for(int j=0;j<=i-1;j++)
                 {
                     a[i]+=a[j]*a[i-1-j];
                 }

             }
    cin>>k;
    cout<<a[k]<<" "<<k+1;
}

 

 

转载于:https://www.cnblogs.com/jackyang/p/3194429.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值