
数学
galesaur_wcy
我们一起加油啊~~~~
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
S - Area of a Parallelogram(数学)
A parallelogram is a quadrilateral with two pairs of parallel sides. See the picture below:Fig: a parallelogramNow you are given the co ordinates of A, B and C, you have to find the coordinates原创 2017-10-05 14:25:40 · 345 阅读 · 0 评论 -
方格
M * N的方格,一个机器人从左上走到右下,只能向右或向下走。有多少种不同的走法?由于方法数量可能很大,只需要输出Mod 10^9 + 7的结果。 Input 第1行,2个数M,N,中间用空格隔开。(2 <= m,n <= 1000000) Output 输出走法的数量 Mod 10^9 + 7。 ...转载 2018-05-12 21:05:37 · 204 阅读 · 1 评论 -
HDU - 4704(费马小定理和快速幂)
Input 2 Output 2 Hint 1. For N = 2, S(1) = S(2) = 1.2. The input file consists of multiple test cases. Sa...原创 2018-04-09 11:44:33 · 369 阅读 · 0 评论 -
数论四大定理
数论四大定理转载来自 http://www.voidcn.com/article/p-tzsmdgch-bkh.html威尔逊定理若p为 质数,则p可整除(p-1)!+1。欧拉定理(也称费马-欧拉定理)若n,a为正整数,且n,a互素,(a,n) = 1,则a^φ(n) ≡ 1 (mod n)孙子定理(又称中国剩余定理)公元前后的《孙子算经》中有“物不知数”问题:“今有物不知其数,三三数之余二 ,五...转载 2018-04-09 10:28:33 · 1718 阅读 · 0 评论 -
F - XOR Equation CodeForces - 635C (数学)
转载来自:http://blog.youkuaiyun.com/mengxiang000000/article/details/55049912F - XOR Equation CodeForces - 635C Two positive integers a and b have a sum of s and a bitwise XOR of x. How many possible values are ...转载 2018-03-19 21:22:23 · 233 阅读 · 0 评论 -
只包含因子2 3 5的数 (思维和二分)
K的因子中只包含2 3 5。满足条件的前10个数是:2,3,4,5,6,8,9,10,12,15。所有这样的K组成了一个序列S,现在给出一个数n,求S中 >= 给定数的最小的数。 例如:n = 13,S中 >= 13的最小的数是15,所以输出15。 Input第1行:一个数T,表示后面用作输入测试的数的数量。(1 第2 - T + 1行:每行1个数N(1 Output共T行原创 2018-01-21 17:14:42 · 573 阅读 · 0 评论 -
[51nod]1284 2 3 5 7的倍数
题目:H给出一个数N,求1至N中,有多少个数不是2 3 5 7的倍数。 例如N = 10,只有1不是2 3 5 7的倍数。Input输入1个数N(1 <= N <= 10^18)。Output输出不是2 3 5 7的倍数的数共有多少。Sample Input10Sample Output1思路:离散数学的包容排斥原理来做代码:#inc...原创 2017-07-16 19:05:30 · 1093 阅读 · 0 评论 -
W - February 29(容斥原理)
It is 2012, and it's a leap year. So there is a "February 29" in this year, which is called leap day. Interesting thing is the infant who will born in this February 29, will get his/her birthday again原创 2017-10-05 16:24:56 · 385 阅读 · 0 评论 -
I - Digits of Factorial (数论)
Factorial of an integer is defined by the following functionf(0) = 1f(n) = f(n - 1) * n, if(n > 0)So, factorial of 5 is 120. But in different bases, the factorial may be different. For example,原创 2017-10-05 20:04:13 · 399 阅读 · 0 评论 -
L - Calm Down(数学几何计算)
George B. wants to be more than just a good American. He wants to make his daddy proud and become a hero. You know, like Shakib Khan.But sneaky as he is, he wants a special revolver that will allow原创 2017-10-05 16:57:18 · 570 阅读 · 0 评论 -
N的倍数 51Nod - 1103 (抽屉原理)
一个长度为N的数组A,从A中选出若干个数,使得这些数的和是N的倍数。 例如:N = 8,数组A包括:2 5 6 3 18 7 11 19,可以选2 6,因为2 + 6 = 8,是8的倍数。 Input 第1行:1个数N,N为数组的长度,同时也是要求的倍数。(2 <= N <= 50000)第2 - N + 1行:数组A的元素。(0 < A...原创 2018-05-19 16:13:32 · 365 阅读 · 0 评论