求助
查看原帖
求助
677581
_Glassy_Sky_楼主2023/9/9 10:31
#include<bits/stdc++.h>
using namespace std;
long long h(long long n, long long x)
{
	if(n == 0)
		return 1;
	else if(n == 1)
		return 2 * x;
	else if(n > 1)
		return 2 * h(n - 1, x) - 2 * (n - 1) * h(n - 2, x);
}
int main()
{
	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	long long n, x;
	cin >> n >> x;
	cout << h(n, x);
	return 0;
}

2023/9/9 10:31
加载中...