2019-01-28 [HDU-2067]

2019-01-28  本文已影响0人  林锦天

include<iostream>

include<algorithm>

using namespace std;
long long a[1000] = {1,1,2 };
int main()
{
long long n,no=1;

for (long long i = 2; i < 999; i++)
{
    for (long long j = 0; j <= i; j++)
    {
        
        a[i+1] += a[j] * a[i - j];
    }
}

while (cin >> n&&n!=-1)
{
    cout << no << ' ' << n <<' '<< 2 * a[n]<<endl;
    no++;
}

}

上一篇 下一篇

猜你喜欢

热点阅读