数论
文章平均质量分 68
圣诞老人家
这个作者很懒,什么都没留下…
展开
-
C - Train Problem II catalan数
C - Train Problem IITime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionAs we all know the Train Problem I, the boss of the Ignati原创 2016-10-26 21:14:12 · 329 阅读 · 0 评论 -
HDU - 4611 A - Balls Rearrangement
Bob has N balls and A boxes. He numbers the balls from 0 to N-1, and numbers the boxes from 0 to A-1. To find the balls easily, he puts the ball numbered x into the box numbered a if x = a mod A. So原创 2017-04-05 17:32:50 · 354 阅读 · 0 评论 -
poj 2800 找规律
Joseph's ProblemTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7519 Accepted: 1977DescriptionJoseph likes taking part in programming contests. His favo原创 2017-04-15 19:02:09 · 595 阅读 · 0 评论 -
I - I-number HDU - 4608
The I-number of x is defined to be an integer y, which satisfied the the conditions below:1. y>x; 2. the sum of each digit of y(under base 10) is the multiple of 10;3. among all integers tha原创 2017-05-02 15:31:28 · 185 阅读 · 0 评论 -
C - Partition HDU - 4602
Define f(n) as the number of ways to perform n in format of the sum of some positive integers. For instance, when n=4, we have 4=1+1+1+1 4=1+1+2 4=1+2+1 4=2+1+1 4=1+3 4=2+2原创 2017-05-02 15:44:16 · 228 阅读 · 0 评论 -
最大子数组
1.问题描述 问题:一个有N个整数元素的一维数组(A[0],A[1],A[2],…A[n-1]),这个数组中子数组之和的最大值是多少? 该子数组是连续的。例如 数组:[1,-2,3,5,-3,2]返回8; 数组:[0,-2,3,5,-1,2]返回9。网上有称之为最大子序列和,亦有称连续子数组最大和。个人觉得叫最大子序列和不太妥,数学上讲,子序列不一定要求连续,而这里我们的题目必然要原创 2017-05-18 17:41:12 · 4910 阅读 · 0 评论 -
最大子数组 hdu 1003 1231
Max SumTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 244589 Accepted Submission(s): 57748Problem DescriptionGiven a sequence a[原创 2017-05-18 17:45:10 · 299 阅读 · 0 评论 -
gym100971G
Alex is repairing his country house. He has a rectangular metal sheet of size a × b. He has to cut two rectangular sheets of sizes a1 × b1 anda2 × b2 from it. All cuts must be parallel to th原创 2017-05-19 11:57:51 · 446 阅读 · 0 评论 -
gym100971
There is a set of n segments with the lengthsli. Find a segment with an integer length so that it could form a non-degenerate triangle with any two segments from the set, or tell that such seg原创 2017-05-19 12:00:18 · 285 阅读 · 0 评论 -
Convex hdu5979
We have a special convex that all points have the same distance to origin point.As you know we can get N segments after linking the origin point and the points on the convex. We can also get N ang原创 2017-06-04 17:57:40 · 414 阅读 · 0 评论 -
hdu 5974 A Simple Math Problem
Given two positive integers a and b,find suitable X and Y to meet the conditions: X+Y=a Least Comm原创 2017-06-09 23:15:21 · 192 阅读 · 0 评论 -
hdu 6143 Killer Names dp
题 目 传 送 门:题意:给出一个m个字母的字母表,问我们能生成多少对字符串,该对字符串长度为n。并且字符串之间不能存在相同的字母思路1:dp[i][j]表示用j中颜色去涂i个格子(j中颜色全用上),然后直接dp。状态转移方程为:dp[i][j]=dp[i-1][j]*j+dp[i-1][j-1]*(m-(j-1));ac代码:#include using names原创 2017-08-18 12:10:35 · 195 阅读 · 0 评论 -
hdu 6053
TrickGCDTime Limit: 5000/2500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 969 Accepted Submission(s): 372Problem DescriptionYou are given an原创 2017-07-28 10:33:04 · 373 阅读 · 0 评论 -
hdu 4465 概率+数学处理
LazyChild is a lazy child who likes candy very much. Despite being very young, he has two large candy boxes, each contains n candies initially. Everyday he chooses one box and open it. He chooses the原创 2017-09-16 09:26:56 · 344 阅读 · 0 评论 -
hdu 4920 矩阵相乘
Given two matrices A and B of size n×n, find the product of them. bobo hates big integers. So you are only asked to find the result modulo 3. InputThe input consists of several tests. For each原创 2017-04-05 08:45:13 · 261 阅读 · 0 评论 -
poj 3863 Business Center
International Cyber Police Corporation (ICPC) had built a new mega-tall business center to host itsheadquarters and to lease some space for extra profit. It has so many floors, that it is impractica原创 2017-04-07 19:17:19 · 564 阅读 · 0 评论 -
组合数学之稳定婚姻问题
E - Marriage is StableTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionAlbert, Brad, Chuck are happy bachelors who are in love原创 2016-10-26 21:27:24 · 1920 阅读 · 0 评论 -
hdu 5317 RGCDQ 预处理和素因子的个数
E - RGCDQTime Limit:3000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 5317DescriptionMr. Hdu is interested in Greatest Common Divisor原创 2016-10-28 14:33:13 · 278 阅读 · 0 评论 -
hdu5651--A - xiaoxin juju needs help 组合数问题
A - xiaoxin juju needs helpTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionAs we all known, xiaoxin is a brilliant coder. He k原创 2016-10-28 18:52:37 · 445 阅读 · 0 评论 -
详解母函数与组合数
母函数与排列组合 在谈论母函数问题之前,我们先看一个简单的问题描述:假如有两组数据(A,B)和(C,D),每组中选出一个构成一个组合,总共有几种选法?很显然总共有4种选法:AC,AD,BC,BD。而且很容易联想到这个式子(A+B)*(C+D)=A*C+A*D+B*C+B*D。式子中的几个乘积项就是上面的4种选法。假如把问题换一下:每组中选出一个或0个数据构成组合,总共有几种组合?那么结果原创 2016-10-28 19:04:01 · 1433 阅读 · 0 评论 -
hdu 2082--找单词 普通型母函数的应用
B - 找单词Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescription假设有x1个字母A, x2个字母B,..... x26个字母Z,同时假设字母A的价值为1,字母B的价值为2,..... 字母Z的价值为26。那原创 2016-10-28 19:47:30 · 269 阅读 · 0 评论 -
寒假安排 求n !中v因子的个数
B - 寒假安排Time Limit:1000MS Memory Limit:64000KB 64bit IO Format:%lld & %lluSubmit Status Practice ACdream 1084Description寒假又快要到了,不过对于lzx来说,头疼的事又来了,因为众多的后宫都指望着能和lzx约会呢,原创 2016-10-28 20:39:51 · 299 阅读 · 0 评论 -
变相的欧拉方程
C - GCDTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionThe greatest common divisor GCD(a,b) of two positive integers a and b,s原创 2016-10-19 19:53:13 · 650 阅读 · 0 评论 -
欧拉水题
F - Farey SequenceTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionThe Farey Sequence Fn for any integer n with n >= 2 is the set原创 2016-10-19 19:58:44 · 193 阅读 · 0 评论 -
唯一分解定理
G - Pairs Forming LCMTime Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionFind the result of the following code:long long pairsFormLC原创 2016-10-19 20:19:57 · 553 阅读 · 0 评论 -
齐肯多夫定理
定理内容:任何正整数都可以表示成若干个不连续的斐波那契数(不包括第一个斐波那契数)之和。以F(n)来表示第n个斐波那契数。m为任意正整数。当m=1,2,3时,因为1=F(2),2=F(3),3=F(4),所以命题成立。下面采用数学归纳法证明定理对任何m均成立。假设定理对任何小于m的正整数数都成立。下证命题对m也成立。(1)若m是斐波那契数,则命题对m也成原创 2016-12-05 17:32:58 · 1471 阅读 · 0 评论 -
矩阵快速幂 求斐波拉切数列的第n项 poj3070
FibonacciTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7241 Accepted: 5131DescriptionIn the Fibonacci integer sequence, F0 = 0, F1 = 1,原创 2017-03-08 17:48:10 · 589 阅读 · 0 评论 -
矩阵快速幂模板
(1)矩阵乘法简单的说矩阵就是二维数组,数存在里面,矩阵乘法的规则:A*B=C其中c[i][j]为A的第i行与B的第j列对应乘积的和,即:(1)矩阵快速幂就是算A^n;方法很简单,把快速幂算法中的乘法改成矩阵的乘法就可以了利用二分的思想然后把所有的数换为具有相同作用的矩阵即可(在快速幂中刚开始需要用1乘,而在矩阵快速幂中就要用单位矩阵)原创 2017-03-08 17:55:46 · 295 阅读 · 0 评论 -
中国(北方)大学生程序设计训练赛(第一周)E. water problem
函数 f:Z+→Zf:Z+→Z。已知 f(1),f(2)f(1),f(2) 的值,且对于任意 x>1x>1,有 f(x+1)=f(x)+f(x−1)+sin(πx2)f(x+1)=f(x)+f(x−1)+sin(πx2)。求 f(n)f(n的值多组数据。(数据组数 T≤100T≤100)每组数据包含 33 个不超过 109109 的正整数,分别代表 f(1),f(原创 2017-03-11 16:31:48 · 515 阅读 · 0 评论 -
hdu5073 数学化简
Good news for us: to release the financial pressure, the government started selling galaxies and we can buy them from now on! The first one who bought a galaxy was Tianming Yun and he gave it to Xin C原创 2017-09-08 20:55:05 · 337 阅读 · 0 评论