
数论
文章平均质量分 81
fanlinqiang
这个作者很懒,什么都没留下…
展开
-
Carmichael Numbers
#include#includeusing namespace std;int main(int ac,char *av[]){ int arr[15]={561, 1105, 1729, 2465, 2821, 6601, 8911, 10585, 15841, 29341, 41041, 46657, 52633, 62745, 63973 };//(原创 2012-06-06 16:49:25 · 534 阅读 · 0 评论 -
Description has only two Sentences
Description has only two SentencesTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 701 Accepted Submission(s): 214Problem Descriptiona转载 2012-11-15 21:35:12 · 506 阅读 · 0 评论 -
快速幂取模和快速取模
基本概念及思想对形如a^b mod m 的运算(b一般较大)但a,b,m都在long型范围内算法的主要思想是分治,分而治之。将大的问题分成若干个相似的较小的问题!具体实现是用递归的方法!举例2^100 mod 3像这种运算如果先算出2^100 的值,然后再模上3,相信比较困难!我们可以将100变小点2^100=(2^50)^2 =((2^25)^2)转载 2012-11-15 15:00:01 · 1832 阅读 · 0 评论 -
Diophantus of Alexandria(求一一个数的因子个数)
Diophantus of AlexandriaTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1683 Accepted Submission(s): 633Problem DescriptionDiophantus转载 2012-11-18 10:40:02 · 801 阅读 · 1 评论 -
Simple Addition Expression(排列组合)
Simple Addition ExpressionTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1155 Accepted Submission(s): 428Problem DescriptionA luxury转载 2012-11-18 14:36:16 · 823 阅读 · 0 评论 -
Set Definition(两个一次函数)
Set DefinitionTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 8784Accepted: 4036DescriptionSet S is defined as follows:(1) 1 is in S; (2) If x转载 2012-11-19 20:39:48 · 472 阅读 · 0 评论 -
a^b(快速幂取模)
http://www.tyvj.cn/Problem_Show.aspx?id=1118a^bFrom Admin描述 Description求a^b 由于结果可能很大,我们现在只需要知道这个值mod 1012就可以了(为什么是1012?我的生日)ab输入格式 InputFormat第一行两个数 a b输出格式 OutputFormat原创 2012-11-20 21:34:32 · 980 阅读 · 0 评论 -
Tr A(矩阵)
Tr A Time Limit : 1000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 5 Accepted Submission(s) : 5Problem DescriptionA为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k转载 2012-12-04 20:06:00 · 9336 阅读 · 0 评论 -
数论小知识
判断一个数是否为奇数 #includeusing namespace std;int main(){ if(3&1)cout<<"yes1"<<endl; if(4&1)cout<<"yes2"<<endl; return 0;}求两个数的最大公约数int gcd(int a,int b){ if(b==0) return原创 2012-11-15 15:19:57 · 486 阅读 · 0 评论 -
Uncle Tom's Inherited Land*(二分匹配)
Uncle Tom's Inherited Land*Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 4 Accepted Submission(s) : 4Special JudgeProblem Description转载 2012-11-25 16:28:43 · 747 阅读 · 0 评论 -
Square Coins(母函数)
Square Coins Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 6 Accepted Submission(s) : 6Problem DescriptionPeople in Silverland use square原创 2012-11-13 21:37:04 · 615 阅读 · 0 评论 -
Holding Bin-Laden Captive!(母函数)
Holding Bin-Laden Captive!Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 1 Accepted Submission(s) : 1Problem DescriptionWe all know that Bi转载 2012-11-10 18:33:12 · 560 阅读 · 1 评论 -
LCM Challenge(最小公倍数)
LCM ChallengeCrawling in process...Crawling failedTime Limit:2000MSMemory Limit:262144KB 64bit IO Format:%I64d & %I64uDescriptionSome days ago, I learned the concept of LCM (least co转载 2012-10-28 14:40:59 · 1000 阅读 · 0 评论 -
The Euler function(欧拉函数)
Problem Description The Euler function phi is an important kind of function in number theory, (n) represents the amount of the numbers which are smaller than n and coprime to n, and this function转载 2012-10-21 22:45:23 · 888 阅读 · 0 评论 -
GCD Again(欧拉函数)
GCD Again Time Limit : 1000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 13 Accepted Submission(s) : 6Problem DescriptionDo you have spent some time to thi原创 2012-10-23 21:38:02 · 922 阅读 · 1 评论 -
Easy Number Challenge(求因子个数)
Crawling in process...Crawling failedTime Limit:2000MSMemory Limit:262144KB 64bit IO Format:%I64d & %I64uDescriptionLet's denote d(n) as the number of divisors of a positive integer原创 2012-10-28 10:46:06 · 602 阅读 · 0 评论 -
X问题
X问题Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1968 Accepted Submission(s): 590Problem Description求在小于等于N的正整数中有多少个X满足:X mod a[0]原创 2012-11-08 23:13:22 · 491 阅读 · 0 评论 -
hdu3364 Lanterns (高斯消元)
Lanterns Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/65536K (Java/Other)Total Submission(s) : 10 Accepted Submission(s) : 8Problem DescriptionAlice has received a beautiful pres转载 2012-11-25 16:08:45 · 536 阅读 · 0 评论 -
Air Raid(二分匹配)
Air Raid Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 11 Accepted Submission(s) : 10Problem DescriptionConsider a town where all the stre转载 2012-11-25 16:24:34 · 575 阅读 · 0 评论 -
Ignatius and the Princess III(拆分数)
Ignatius and the Princess IIITime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 4 Accepted Submission(s) : 4Problem Description"Well, it seem转载 2012-11-10 18:11:11 · 495 阅读 · 0 评论 -
数论——拆分数++母函数模版
首先,我们引进一个小小概念来方便描述吧,record[n][m]是把自然数划分成所有元素不大于m的分法,例如:当n=4,m=1时,要求所有的元素都比m小,所以划分法只有1种:{1,1,1,1};当n=4,m=2时,。。。。。。。。。。。。。。。。只有3种{1,1,1,1},{2,1,1},{2,2};当n=4,m=3时,。。。。。。。。。。。。。。。。只有4种{1,1,1,转载 2012-11-10 18:13:13 · 875 阅读 · 0 评论 -
一个斐波那契数列
一个斐波那契数列题目描述雍神对数学一直都非常感兴趣。最近在学习斐波那契数列的它,向你展示了一个数字串,它称之为“斐波那契”串:11235813471123581347112358........聪明的你当然一眼就看出了这个串是这么构造的:1.先写下两位在0~9范围内的数字a, b,构成串ab;2.取串最后的两位数字相加,将和写在串的最后面。上面雍神向原创 2012-12-12 21:15:17 · 754 阅读 · 0 评论