摘要: 1 #include 2 #include 3 #include 4 #include 5 #define mod 1000000007 6 long long dp[1010]; 7 void getdp() 8 { 9 memset(dp,0,sizeof(dp));10 dp[1]=1;11 for(int i=2;i<=1000;i++)12 {13 for(int j=1;j<=i;j++)14 {15 if ((i-1)%j==0) dp[i]+=dp[j],dp[i]=dp[i]%mod;1... 阅读全文
posted @ 2013-10-31 13:29 little_w 阅读(146) 评论(0) 推荐(0)
摘要: 1 //http://www.cnblogs.com/yefeng1627/archive/2013/04/24/3040112.html 2 #include 3 #include//最好开这个库//数学计算交c++更快 4 #include 5 #include 6 #include 7 #define maxn 410000 8 double F[maxn]; 9 void builtF()10 {11 F[1]=0;12 for(int i=1;i log(C(m,n))=log(n!)-log(m!)-log((n-m)!) 要知道log(10000!)都是很小的,... 阅读全文
posted @ 2013-10-31 13:22 little_w 阅读(372) 评论(0) 推荐(0)
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 struct Node 6 { 7 int r;//余数 8 int f;//父亲节点 9 int n;//数字10 Node(){};11 Node(int r1,int f1,int n1){r=r1;f=f1;n=n1;}12 }node[10010<<2];13 int d[11];14 bool rem[11000];15 int n,m;16 void print(int f)17 {18 if (node[f].f!... 阅读全文
posted @ 2013-10-31 12:51 little_w 阅读(205) 评论(0) 推荐(0)