
组合数学
绝尘花遗落
一骑红尘妃子笑,无人知是荔枝来
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【UVA11426】GCD - Extreme (II)——欧拉函数
Given the value of N, you will have to find the value of G. The definition of G is given below: G=∑i=1n∑j=i+1nGCD(i,j)G= \sum\limits_{i=1}^{n} \sum\limits_{j=i+1}^nGCD(i,j) Here GCD(i, j) means the gr原创 2016-03-30 18:07:27 · 901 阅读 · 0 评论 -
101Hack44
Hackerrank101hack44Picking NumbersAlice and Bob's Silly GameExpected Tree LeavesPalindromic Subsets原创 2016-12-15 12:06:59 · 560 阅读 · 0 评论 -
2013 Multi-University Training Contest 1
【4609HDU】3-idiots——组合计数+FFT Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionKing OMeGa catched three men who had been streaking in the street. Lo原创 2016-11-20 10:28:59 · 646 阅读 · 0 评论 -
2016 Multi-University Training Contest 6
HDU【5793】——A Boring QuestionHDU【5794】——A Simple ChessHDU【5795】——A Simple NimTo My GirlfriendHDU【5802】——Windows 10原创 2016-08-04 21:18:05 · 1075 阅读 · 0 评论 -
排列组合专题
【Bzoj】1227: [SDOI2009]——虔诚的墓主人[NOIP2011]多项式系数【Bzoj】3505: [Cqoi2014]——数三角形原创 2016-08-17 11:28:46 · 1124 阅读 · 1 评论 -
2016 Multi-University Training Contest3
HDU【5752】——Sqrt Bo Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Problem DescriptionLet’s define the function f(n)=|n√|f(n)=|\sqrt{n}|.Bo wanted to know the mini原创 2016-07-27 15:27:16 · 1597 阅读 · 4 评论 -
Topcoder SRM 636 Div1 B
题意:给你一个矩阵,矩阵中有’.’和’#’,’.’表示空闲的地方,’#’表示非空闲的地方,现在有r个机器人,在空闲的地方等概率的选择一个空闲的地方。现在定义他们之间的关系,对于一个机器人,他和距离他最近的机器人有一条边,如果距离相等,那么选择列坐标小的,如果还相等,选择行坐标小的。所谓的距离为他们之间的欧几里得距离。对于选定位置的机器人,会形成r条边r个点的有向图,那么问在这些可能形成的图中连通分量原创 2016-06-03 16:44:11 · 457 阅读 · 0 评论 -
【SPOJ VLATTICE】Visible Lattice Points——莫比乌斯反演3
Consider a N*N*N lattice. One corner is at (0,0,0) and the opposite one is at (N,N,N). How many lattice points are visible from corner at (0,0,0) ? A point X is visible from point Y iff no other lattic原创 2016-05-12 14:07:45 · 556 阅读 · 0 评论 -
【SPOJ PGCD】Primes in GCD Table——莫比乌斯反演2
PGCD - Primes in GCD TableJohnny has created a table which encodes the results of some operation – a function of two arguments. But instead of a boring multiplication table of the sort you learn by hea原创 2016-05-12 10:55:41 · 676 阅读 · 0 评论 -
【UVA11361】Investigating Div-Sum Property——数位DP
An integer is divisible by 3 if the sum of its digits is also divisible by 3. For example, 3702 is divisible by 3 and 12(3+7+0+2) is also divisible by 3. This property also holds for the integer 9. I原创 2016-03-28 19:52:17 · 965 阅读 · 2 评论 -
【UVA11174】Stand in a Line——逆元+树形Dp
All the people in the byteland want to stand in a line in such a way that no person stands closer to the front of the line than his father. You are given the information about the people of the bytela原创 2016-03-27 19:53:19 · 625 阅读 · 0 评论 -
【UVA11137】Ingenuous Cubrency——完全背包
题意:给你一个数n,将n分解成若干个正整数的立方之和,问有多少种方式。 分析:将一个数ii的立方数作为一个物品,体积为i3i^3,每一个物品的个数没有限制,转化为完全背包的形式。#include <cstdio>#include <cstring>#include <cstdlib>#include <cmath>#include <iostream>#include <alg原创 2016-03-27 17:16:52 · 495 阅读 · 0 评论 -
【UVA11806】Cheerleaders——容斥
题意:给你一个n×mn \times m的矩阵网格和k个人,问有多少种方法使得每一个格子只放一个人,并且第一行,最后一行,第一列,最后一列都有人。 分析:如果没有限制条件,我们知道答案是ans=C(nm,k),但是有限制条件,我们定义A表示第一行没有人,B表示最后一行没有人,C表示第一列没有人,D表示最后一列没有人,我们可以得到答案是ans=ans−A−B−C−D+AB+AC+AD⋯+AB原创 2016-03-25 19:47:40 · 610 阅读 · 0 评论 -
【UVA10325】The Lottery——简单容斥定理
题意:给你一个数组,问[1,n][1,n]中有多少个数不能整除数组的任何一个数 分析:对于这种问题,我们可以求其逆问题,就是在区间[1,n]中存在多少数可以整除数组中的只少一个数 对于a[i],可以整除它的数的数量为Ai=na[i],但是我们不能将每一个数的数量加起来,因为存在重复元素a[i],可以整除它的数的数量为A_i = \frac{n}{a[i]},但是我们不能将每一个数的数原创 2016-03-24 21:41:38 · 787 阅读 · 0 评论 -
【UVA11401】Triangle Counting——计算方法
题意:从 1,2,3⋯,n1,2,3\cdots ,n中选出三个不同的整数,使它们能够组成三角形,问有多少种方法 分析:设最长的边为xx,另外的两条边为y,z\quad y,z ,所以y+z>x\quad y+z>x,所以z的范围为x>z>x−yx>z>x-y 当y=1时,x>z>x−1显然无解当\quad y =1 时,x>z>x-1\quad 显然无解 当y=2时,x>z>原创 2016-03-24 20:55:24 · 906 阅读 · 0 评论 -
【UVA11538】Chess Queen——简单组合
题意:给你一个n×mn \times m 的棋盘,在上面放两个皇后,(一黑一白)问有多少种放的方法 分析:皇后的攻击的范围为同一行或者同一列或者在同一对角线,这三种情况没有交集,利用加法原理,对于同一行的放置数目为A(n,m)=n×m×(m−1)A(n,m) = n\times m\times (m-1),同一列的放置为B(m,n)=m×n×(n−1)B(m,n) = m\times n原创 2016-03-24 19:54:28 · 799 阅读 · 0 评论 -
【POJ3101】Astronomy——分子的最小公倍数
AstronomyTime Limit: 2000MS Memory Limit: 65536KDescriptionThere are n planets in the planetary system of star X. They orbit star X in circular orbits located in the same plane. Their tangent velo原创 2016-04-04 10:53:33 · 1625 阅读 · 0 评论 -
【POJ2891】Strange Way to Express Integers——中国剩余定理(非互质)
Strange Way to Express Integers Time Limit: 1000MS Memory Limit: 131072KDescriptionElina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. The原创 2016-04-02 10:57:49 · 872 阅读 · 0 评论 -
HourRrank17
HackerrankHourRank17原创 2017-02-09 10:35:09 · 935 阅读 · 0 评论