美文网首页
2019-01-28 [HDU-2067]

2019-01-28 [HDU-2067]

作者: 林锦天 | 来源:发表于2019-01-28 11:15 被阅读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++;
}

}

相关文章

网友评论

      本文标题:2019-01-28 [HDU-2067]

      本文链接:https://www.haomeiwen.com/subject/aaxajqtx.html