您的位置:首页 > 其它

【BZOJ3028】食物 母函数

2015-01-18 23:00 337 查看
不会,只能在题解上看到结论再来写。

/article/2348380.html

不妨看这篇。

代码:(就是求C(n+2,3))

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define N 505
#define INV 1668
#define MOD 10007
using namespace std;
long long n;
char s
;
int main()
{
	int i;
	scanf("%s",s+1);
	for(i=1;s[i];i++)
		n=n*10+s[i]-'0',n%=MOD;
	cout<<(n*(n+1)*(n+2)*INV%MOD)<<endl;
	return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: