![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数学
文章平均质量分 75
Kefault
这个作者很懒,什么都没留下…
展开
-
hdu 5179-beautiful number
题目:给定一个区间的两个区间端点l和r,问在l和r之间有多少满足下列情况的数字---这个数字应该满足前一位是后一位的倍数。分析:这是一个经典的数位DP的题目,我们可以把区间求和转化成两个区间的减法,即S[1,r]-S[1,l-1]就是我们求得的答案。 那么问题就转化成了求1-n之间满足情况的数的个数,那么我们就要使用dp[i][j]求得数字长度为i,首数字为j的满足情况的数原创 2015-03-10 18:44:58 · 807 阅读 · 0 评论 -
hdu 4919 Exclusive or
Exclusive orTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 327 Accepted Submission(s): 137Problem DescriptionGiven n, find原创 2014-08-06 17:12:47 · 1331 阅读 · 0 评论 -
hdu 3117 Fibonacci Numbers
Fibonacci NumbersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1766 Accepted Submission(s): 695Problem DescriptionThe Fibon原创 2014-07-30 18:51:07 · 941 阅读 · 0 评论 -
hdu 4920 Matrix multiplication
Matrix multiplicationTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 334 Accepted Submission(s): 112Problem DescriptionGive原创 2014-08-05 18:00:44 · 1038 阅读 · 0 评论 -
hdu 1130 How Many Trees?
How Many Trees?Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2824 Accepted Submission(s): 1654Problem DescriptionA binary s原创 2014-07-28 19:16:37 · 738 阅读 · 0 评论 -
hdu 3306 Another kind of Fibonacci
Another kind of FibonacciTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1526 Accepted Submission(s): 583Problem DescriptionA原创 2014-07-27 23:37:12 · 771 阅读 · 0 评论 -
hdu 1588 Gauss Fibonacci(矩阵快速幂)
Gauss FibonacciTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2090 Accepted Submission(s): 903Problem DescriptionWithout exp原创 2014-07-27 22:59:21 · 757 阅读 · 0 评论 -
hdu 1757 A Simple Math Problem(矩阵快速幂)
A Simple Math ProblemTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2512 Accepted Submission(s): 1461Problem DescriptionLele原创 2014-07-27 22:24:12 · 825 阅读 · 0 评论 -
hdu 2814 Interesting Fibonacci
Interesting FibonacciTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 712 Accepted Submission(s): 137Problem DescriptionIn mat原创 2014-07-27 22:11:02 · 972 阅读 · 0 评论 -
HIT 2255 Not Fibonacci(矩阵快速幂)
Not FibonacciMy Tags (Edit) Source : 计算机学院第二届“光熙杯”程序设计大赛 Time limit : 3 sec Memory limit : 32 MSubmitted : 452, Accepted : 121原创 2014-07-25 19:09:51 · 833 阅读 · 0 评论 -
梅森素数
梅森数:假设正整数p,Mp=2^p-1原创 2014-05-31 16:40:20 · 1395 阅读 · 0 评论 -
hdu 4861 Couple doubi
Couple doubiTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 607 Accepted Submission(s): 435Problem DescriptionDouBiXp has a g原创 2014-07-23 17:40:22 · 814 阅读 · 0 评论 -
hdu 4869 Turn the pokers
Turn the pokersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 731 Accepted Submission(s): 254Problem DescriptionDuring summe原创 2014-07-23 18:53:36 · 935 阅读 · 0 评论 -
hdu 4965 Fast Matrix Calculation
Fast Matrix CalculationTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 161 Accepted Submission(s): 92Problem DescriptionOne原创 2014-08-19 19:36:16 · 952 阅读 · 0 评论 -
bnu 34985 Elegant String(矩阵快速幂+dp推导公式)
Elegant StringTime Limit: 1000msMemory Limit: 65536KB64-bit integer IO format: %lld Java class name: MainPrev Submit Status Statistics Discuss NextType: None原创 2014-08-16 19:55:47 · 1351 阅读 · 0 评论 -
hdu 5015 233 Matrix
233 MatrixTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 392 Accepted Submission(s): 262Problem DescriptionIn our daily lif原创 2014-09-15 19:32:34 · 1179 阅读 · 0 评论 -
hdu 5171-GTY's birthday gift(矩阵快速幂)
题目及代码:题目大意就是给定一个含有n个元素的序列,进行k次操作---每次操作从序列里面选择两个数,求和并将结果放在这个序列中,使得k次操作后这个序列中的元素和最大。 当然为了满足最大这个要求,那么我们每次当然是从序列中选择最大的两个元素相加,结果放在这个序列中,这个结果比为序列元素的最大元素。这样我们只需要找到原序列中最大的两个元素,累加就可以了。简单化简一下就知道这是一个经典的菲波那原创 2015-03-11 16:30:43 · 515 阅读 · 0 评论 -
hdu 5175-Misaki's Kiss again
题目及代码:题目大意就是 给定一个数n,找出所有的m(m>=1&&m 本来觉得这个n一定是要进行素因子分解的,之后利用因子枚举n所有的约数,然后思路就断了。索性看了看官方的题解,的确是要枚举n所有的因子,不过不需要素因子分解,直接暴力就可以了。然后我们假设gcd(n,m)=k,这里k是n的一个因子,那么我们就可以得出n^m=k,这里两边同时亦或n,原创 2015-03-11 14:57:39 · 697 阅读 · 0 评论 -
hdu 5183-Negative and Positive (NP)
题目:大概意思就是给定一个序列a[0],a[1]....a[n-1]和一个整数k,问是否有这样的两个下标是的NP-Sum(i,j)=k,这里NP-Sum(i,j)=a[i]-a[i+1]+a[i+2]-...+(-1)^(j-1)*a[j]。思路:我们可以维护这个序列的后缀和(前缀也是可以的),然后枚举sum[i]查看在set表中是否存在sum[j]=sum[i]-k。这里要分成i原创 2015-03-09 21:08:28 · 692 阅读 · 0 评论 -
hdu 5187-zhx's contest
题目及代码:大意就是给定一个数n,问使用数字1到n能组合出多少组同时满足下列两种情况的序列: 1.序列中的数字从第一项到第i项(1≤i≤n),满足单调递增或者递减; 2.序列中的数字从第i项到第n项满足单调递增或者递减; 官方题解给的是2^n-2(n≥2),n=1时为1。推到方法不明......原创 2015-03-16 16:43:55 · 742 阅读 · 0 评论 -
acdream 1234 Two Cylinders
Two CylindersSpecial JudgeTime Limit: 10000/5000MS (Java/Others)Memory Limit: 128000/64000KB (Java/Others)SubmitStatisticNext ProblemProblem Description In this problem your t原创 2014-10-05 18:27:56 · 1147 阅读 · 0 评论 -
hdu 4059 The Boss on Mars
The Boss on MarsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1934 Accepted Submission(s): 580Problem DescriptionOn Mars, t原创 2014-10-16 17:45:38 · 1263 阅读 · 0 评论 -
hdu 4810 Wall Painting
Wall PaintingTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1265 Accepted Submission(s): 360Problem DescriptionMs.Fang love原创 2014-10-09 18:14:22 · 1144 阅读 · 0 评论 -
acdream 1431 Sum vs Product
Sum vs ProductTime Limit: 4000/2000MS (Java/Others)Memory Limit: 128000/64000KB (Java/Others)SubmitStatisticNext ProblemProblem Description Peter has just learned mathematics. H原创 2014-10-06 18:26:27 · 1157 阅读 · 0 评论 -
hdu 5060 War
WarTime Limit: 8000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 98 Accepted Submission(s): 28Special JudgeProblem DescriptionLong long ago原创 2014-10-06 11:30:53 · 2312 阅读 · 2 评论 -
hdu 5073 Galaxy
GalaxyTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 323 Accepted Submission(s): 71Special JudgeProblem DescriptionGood ne原创 2014-10-22 20:13:41 · 2045 阅读 · 0 评论 -
hdu 5047 Sawtooth
SawtoothTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 258 Accepted Submission(s): 78Problem DescriptionThink about a plane:原创 2014-09-27 19:34:56 · 1135 阅读 · 2 评论 -
hdu 4870 Rating
RatingTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 414 Accepted Submission(s): 261Special JudgeProblem DescriptionA littl原创 2014-07-23 19:35:16 · 922 阅读 · 0 评论 -
反素数
文章来源:引用地址 对于任何正整数x,其约数的个数记做g(x).例如g(1)=1,g(6)=4.如果某个正整数x满足:对于任意i(0性质: 性质一:一个反素数的质因子必然是从2开始连续的质数. 性质二:p=2^t1*3^t2*5^t3*7^t4.....必然t1>=t2>=t3>=....模版:转载 2014-03-05 16:59:47 · 774 阅读 · 0 评论 -
zoj 3538 Arrange the Schedule
Arrange the ScheduleTime Limit: 1 Second Memory Limit: 65536 KBIn Summer 2011, the ZJU-ICPC Team has a n-days training schedule. ZJU-ICPC Team has been divided into 4 Group: Akiba, BiliBi原创 2014-05-23 21:58:19 · 996 阅读 · 0 评论 -
codeforces 219B Special Offer! Super Price 999 Bourles!
#include #include #include using namespace std;int main() { unsigned long long m,n,d,t=1,l,sum=0; while(cin>>m>>d) { unsigned long long n,t=1,l,sum=0; n=m; while(sum<d) { while(sum+t<=d原创 2014-03-19 15:30:46 · 1090 阅读 · 0 评论 -
codeforce 205C - Little Elephant and Interval
DescriptionThe Little Elephant very much loves sums on intervals.This time he has a pair of integers l and r(l ≤ r). The Little Elephant has to find the number of such integers x(l ≤ x ≤ r), t原创 2014-03-06 20:07:23 · 1568 阅读 · 0 评论 -
素数定理
素数定理:随着x的增长,π(x)/(x/ln(x))=1,(π(x)为小于x的素数的个数)。素数个数的位数Time Limit 1000msMemory Limit 65536Kdescription小明是一个聪明的孩子,对数论有着很浓烈的兴趣。他原创 2014-03-02 13:34:28 · 2809 阅读 · 0 评论 -
6N±1素数筛选法
筛选法介绍: 所有的数都能用6N+x的形式表示出来,很容易看出6N+2,6N+3,6N+4均不可能是素数,所以素数只能是形如6N±1的形式,此时只需要对6N±1的数进行判断是否是素数就行了。筛选法的模版:int prime[N];bool isprime(int k){ if(k==2) return true; if(k%2==0) return转载 2014-03-02 14:29:10 · 2184 阅读 · 0 评论 -
hdu 1717
小数化分数2Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2606 Accepted Submission(s): 1060Problem DescriptionRay 在数学课上听老师说,任何小数都能表示成原创 2014-02-28 17:00:37 · 1096 阅读 · 0 评论 -
codeforces 214B - Hometask
B. Hometasktime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFurik loves math lessons very much, so he doesn't原创 2013-12-30 23:58:29 · 1087 阅读 · 0 评论 -
hdu 4473 Exam
Problem DescriptionRikka is a high school girl suffering seriously from Chūnibyō (the age of fourteen would either act like a know-it-all adult, or thinks they have special powers no one else has. Y原创 2013-10-04 14:24:51 · 1468 阅读 · 0 评论 -
Uva 550 - Multiplying by Rotation
Warning: Not all numbers in this problem are decimal numbers!Multiplication of natural numbers in general is a cumbersome operation. In some cases however the product can be obtained by moving the转载 2013-08-04 20:45:22 · 784 阅读 · 0 评论 -
UVa10250 – The Other Two Trees
Special Judge You have a quadrilateral shaped land whose opposite fences are of equal length. You have four neighbors whose lands are exactly adjacent to your four fences, that means you have a转载 2013-08-04 20:43:11 · 773 阅读 · 0 评论 -
UVA 550 - Multiplying by Rotation
Warning: Not all numbers in this problem are decimal numbers!Multiplication of natural numbers in general is a cumbersome operation. In some cases however the product can be obtained by moving the转载 2013-07-29 16:16:44 · 1032 阅读 · 0 评论