# bzoj 3028 食物

$n-1$次的系数为 $\frac{f^(n-1)(0)}{(n-1)!}$

$f'=(-4)*(u)^{-5}*(1-x)'=4*(1-x)^{-5}$求导以此类推

 1 #include<iostream>
2 #include<cstdio>
3 #include<cstring>
4 #include<cstdlib>
5 #include<cmath>
6 #include<algorithm>
7 #include<queue>
8 #include<vector>
9 #include<map>
10 #include<set>
11 #define ll long long
12 #define inf 2139062143
13 #define MAXN 100100
14 #define MOD 10007
15 #define rep(i,s,t) for(register int i=(s),i##__end=(t);i<=i##__end;++i)
16 #define dwn(i,s,t) for(register int i=(s),i##__end=(t);i>=i##__end;--i)
17 #define ren(x) for(register int i=fst[x];i;i=nxt[i])
18 #define pb(i,x) vec[i].push_back(x)
19 #define pls(a,b) (a+b)%MOD
20 #define mns(a,b) (a-b+MOD)%MOD
21 #define mlp(a,b) (1LL*(a)*(b))%MOD
22 using namespace std;
24 {
25     int x=0,f=1;char ch=getchar();
26     while(!isdigit(ch)) {if(ch=='-') f=-1;ch=getchar();}
27     while(isdigit(ch)) {x=x*10+ch-'0';ch=getchar();}
28     return x*f;
29 }
30 int n;char ch;
31 int q_pow(int bas,int t,int res=1)
32 {
33     for(;t;bas=mlp(bas,bas),t>>=1)
34         if(t&1) res=mlp(res,bas);return res;
35 }
36 int main()
37 {
38     ch=getchar();
39     while(isdigit(ch)) {n=(n*10+ch-'0')%MOD;ch=getchar();}
40     printf("%d\n",mlp(mlp(mlp(n,n+1),n+2),q_pow(6,MOD-2)));
41 }
View Code

posted @ 2019-02-26 17:50  jack_yyc  阅读(389)  评论(0编辑  收藏  举报