## SGU 130 解题报告

http://acm.sgu.ru/problem.php?contest=0&problem=130

## 130. Circle

time limit per test: 0.50 sec.
memory limit per test: 4096 KB

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.

`2`

`2 3`

### CODE

```#include<iostream> #include<string.h> using namespace std;   int main() { int i,j,k; long long D[31]; memset(D,0,sizeof(D)); D[0]=1;D[1]=1;D[2]=2; for(i=3;i<=30;++i) for(j=1;j<=i;++j) D[i]+=D[j-1]*D[i-j]; cin>>i; cout<<d[i]<<" "<<i+1<<endl; return 0; }```
» 本博客采用署名 2.5 中国大陆许可协议进行许可，本文版权归作者所有，欢迎转载，但必须在明显位置给出原文连接。