上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 20 下一页
摘要: Lucas定理是用来求 c(n,m) mod p 的值(p为素数) 一般用于求组合数,防止其爆long long Lucas定理:我们令n=sp+q , m=tp+r .(q ,r ≤p) 那么: C(sp+q,tp+r)与C(s,t)*C(q,r)同余 (在编程时你只要继续对 调用Lucas定理即可。 代码可以递归的去完成这个过程,其中递归终点为t = 0 ; 时间O(log... 阅读全文
posted @ 2017-01-17 14:50 Pic 阅读(99) 评论(0) 推荐(0) 编辑
摘要: Problem Description People in Silverland use square coins. Not only they have square shapes but also their values are square numbers. Coins with values of all square numbers up to 289 (=17^2), i.e., 1... 阅读全文
posted @ 2017-01-17 14:13 Pic 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2017-01-17 14:07 Pic 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 转自博客园ID:2108,老卢同志 http://www.cnblogs.com/--ZHIYUAN/p/6102893.html Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): ... 阅读全文
posted @ 2017-01-16 17:31 Pic 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 母函数(Generating function)详解 — Tanky Woo 在数学中,某个序列的母函数(Generating function,又称生成函数)是一种形式幂级数,其每一项的系数可以提供关于这个序列的信息。使用母函数解决问题的方法称为母函数方法。 母函数可分为很多种,包括普通母函数、指数母函数、L级数、贝尔级数和狄利克雷级数。对每个序列都可以写出以上每个类型的一个母函数。构造母函... 阅读全文
posted @ 2017-01-16 17:27 Pic 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Problem Description We all know that Bin-Laden is a notorious terrorist, and he has disappeared for a long time. But recently, it is reported that he hides in Hang Zhou of China! “Oh, God! How terribl... 阅读全文
posted @ 2017-01-16 17:03 Pic 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Problem Description The greatest common divisor GCD(a,b) of two positive integers a and b,sometimes written (a,b),is the largest divisor common to a and b,For example,(1,2)=1,(12,18)=6.(a,b) can be ea... 阅读全文
posted @ 2017-01-15 21:16 Pic 阅读(236) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/zhjchengfeng5/article/details/7786595 扩展欧几里德算法 谁是欧几里德?自己百度去 先介绍什么叫做欧几里德算法 有两个数 a b,现在,我们要求 a b 的最大公约数,怎么求?枚举他们的因子?不现实,当 a b 很大的时候,枚举显得那么的naïve ,那怎么做? 欧几里德有个... 阅读全文
posted @ 2017-01-15 19:08 Pic 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 好像目前还没有这方面题目的总结。这几天连续看到四个问这类题目的人,今天在这里简单写一下。这里我们不介绍其它有关矩阵的知识,只介绍矩阵乘法和相关性质。 不要以为数学中的矩阵也是黑色屏幕上不断变化的绿色字符。在数学中,一个矩阵说穿了就是一个二维数组。一个n行m列的矩阵可以乘以一个m行p列的矩阵,得到的结果是一个n行p列的矩阵,其中的第i行第j列位置上的数等于前一个矩阵第i行上的m个数与后一... 阅读全文
posted @ 2017-01-15 16:52 Pic 阅读(284) 评论(0) 推荐(0) 编辑
摘要: Problem Description Lele now is thinking about a simple function f(x).If x = 10 f(x) = a0 * f(x-1) + a1 * f(x-2) + a2 * f(x-3) + …… + a9 * f(x-10);And ai(0 using namespace std; struct node { int ... 阅读全文
posted @ 2017-01-15 16:50 Pic 阅读(224) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 20 下一页