
组合数学
coldfresh
那我们开始吧
展开
-
Astronomy POJ - 3101(LCM 和DCD)
There are n planets in the planetary system of star X. They orbit star X in circular orbits located in the same plane. Their tangent velocities are constant. Directions of orbiting of all planets are t原创 2017-06-06 11:15:30 · 425 阅读 · 0 评论 -
【51nod 1161】 Partial Sums (组合数学)
题目来源: CodeForces 基准时间限制:2 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 给出一个数组A,经过一次处理,生成一个数组S,数组S中的每个值相当于数组A的累加,比如:A = {1 3 5 6} => S = {1 4 9 15}。如果对生成的数组S再进行一次累加操作,{1 4 9 15} => {1 5 14 29},现在给出数组A,问进行...原创 2018-09-07 15:15:24 · 387 阅读 · 0 评论 -
【ZOJ - 2116】Christopher's Christmas Letter(Lucas)
Dashing thro’ the snow, In a one-horse open sleigh, O’er the fields we go, Laughing all the way; Bells on bobtail ring, Making spirits bright; What fun it is to ride and sing A sleighing song t...原创 2018-08-24 14:19:56 · 237 阅读 · 0 评论 -
【bzoj1284】树的计树(组合数学+prufer数列)
一个有n个结点的树,设它的结点分别为v1, v2, …, vn,已知第i个结点vi的度数为di,问满足这样的条件的不同的树有多少棵。给定n,d1, d2, …, dn,编程需要输出满足d(vi)=di的树的个数。Input 第一行是一个正整数n,表示树有n个结点。第二行有n个数,第i个数表示di,即树的第i个结点的度数。其中1<=n<=150,输入数据保证满足条件的树不超过10^...原创 2018-08-23 16:15:44 · 776 阅读 · 0 评论 -
【HDU 5917】Instability(ramsey定理)
Long long ago, there was a prosperous kingdom which consisted of n cities and every two cites were connected by an undirected road.However, one day a big monster attacked the kingdom and some roads ...原创 2018-08-16 19:43:12 · 255 阅读 · 0 评论 -
Almost Identity Permutations CodeForces - 888D (错排公式)
A permutation p of size n is an array such that every integer from 1 to n occurs exactly once in this array.Let’s call a permutation an almost identity permutation iff there exist at least n - k indice原创 2017-11-12 16:40:57 · 758 阅读 · 0 评论 -
hannnnah_j’s Biological Test HDU - 5894 (组合数)
hannnnah_j is a teacher in WL High school who teaches biology.One day, she wants to test m students, thus she arranges n different seats around a round table.In order to prevent cheating, she thinks th原创 2017-09-08 12:16:26 · 443 阅读 · 0 评论 -
HDU 4135 Co-prime(容斥原理)
Given a number N, you are asked to count the number of integers between A and B inclusive which are relatively prime to N. Two integers are said to be co-prime or relatively prime if they have no com原创 2017-07-19 14:44:36 · 430 阅读 · 0 评论 -
GCD HUD 1695(容斥原理)
Given 5 integers: a, b, c, d, k, you’re to find x in a…b, y in c…d that GCD(x, y) = k. GCD(x, y) means the greatest common divisor of x and y. Since the number of choices may be very large, you’re only原创 2017-07-18 23:18:09 · 405 阅读 · 0 评论 -
【51nod 1556】计算(默慈金数)
描述:有一个1n的矩阵 固定第一个数为1 其他填正整数 且相邻数的差不能超过1 求方案数%1e9+7的结果输入一个数n 表示1n的矩阵(n<=10^6)输出一个数 表示方案数%1e9+7的结果输入样例3输出样例5用到一个叫默慈金数的东西,具体描述自行百度。给出递推关系式子。Mn=(2n+1)Mn−1+(3n−3)Mn−2n+2M_{n}=\frac{(2n+1)M_{...原创 2018-11-02 19:45:05 · 366 阅读 · 0 评论