
数论
文章平均质量分 76
Lionel_D
这个作者很懒,什么都没留下…
展开
-
hdu 1018 Big Number 两种方法 log方法(300+ms)+斯特林公式(0+ms)
Problem DescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are given a number, you have to determine the number of digit原创 2015-03-10 17:02:39 · 1165 阅读 · 0 评论 -
hdu 3037 Saving Beans 组合数取模模板题。。
Problem DescriptionAlthough winter is far away, squirrels have to work day and night to save beans. They need plenty of food to get through those long cold days. After some time the squirrel family thinks that they have to solve a problem. They suppose th原创 2015-05-08 20:07:43 · 1064 阅读 · 0 评论 -
hdu 1212 Big Number 数论~大数取余,,还记得秦九昭算法吗~~
Problem DescriptionAs we know, Big Number is always troublesome. But it's really important in our ACM. And today, your task is to write a program to calculate A mod B.To make the problem easier, I promise that B will be smaller than 100000.Is it too h原创 2015-03-11 18:48:44 · 1299 阅读 · 0 评论 -
hdu 1023 Train Problem II 这题运用到大数相乘+大数相除+卡特兰数
Problem DescriptionAs we all know the Train Problem I, the boss of the Ignatius Train Station want to know if all the trains come in strict-increasing order, how many orders that all the trains can get out of the railway. InputThe input contains sever原创 2015-04-03 16:40:45 · 1033 阅读 · 0 评论 -
hdu 1788 Chinese remainder theorem again 最小公倍数
Problem Description我知道部分同学最近在看中国剩余定理,就这个定理本身,还是比较简单的:假设m1,m2,…,mk两两互素,则下面同余方程组:x≡a1(mod m1)x≡a2(mod m2)…x≡ak(mod mk)在0<=<m1m2…mk内有唯一解。记Mi=M/mi(1<=i<=k),因为(Mi,mi)=1,故有二个整数pi,qi满足Mipi+miqi=1,如果记ei=Mi/pi,那么会有:ei≡0(mod mj),j!=iei≡1(mod mj),j=i很显然,e1原创 2015-03-31 18:58:36 · 956 阅读 · 0 评论 -
hdu 1576 A/B 欧几里德算法的扩展
Problem Description要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。 Input数据的第一行是一个T,表示有T组数据。每组数据有两个数n(0 <= n < 9973)和B(1 <= B <= 10^9)。 Output对应每组数据输出(A/B)%9973。原创 2015-03-31 18:03:10 · 868 阅读 · 0 评论 -
hdu 1214 圆桌会议 简单数论
Problem DescriptionHDU ACM集训队的队员在暑假集训时经常要讨论自己在做题中遇到的问题.每当面临自己解决不了的问题时,他们就会围坐在一张圆形的桌子旁进行交流,经过大家的讨论后一般没有解决不了的问题,这也只有HDU ACM集训队特有的圆桌会议,有一天你也可以进来体会一下哦:),在一天在讨论的时候,Eddy想出了一个极为古怪的想法,如果他们在每一分钟内,一对相邻的两个ACM队员交换一下位子,那么要多少时间才能得到与原始状态相反的座位顺序呢?(即对于每个队员,原先在他左面的队员后来在他右面原创 2015-03-14 15:07:41 · 949 阅读 · 0 评论 -
hdu 1262 寻找素数对 数论 打表。
Problem Description哥德巴赫猜想大家都知道一点吧.我们现在不是想证明这个结论,而是想在程序语言内部能够表示的数集中,任意取出一个偶数,来寻找两个素数,使得其和等于该偶数.做好了这件实事,就能说明这个猜想是成立的.由于可以有不同的素数对来表示同一个偶数,所以专门要求所寻找的素数对是两个值最相近的. Input输入中是一些偶整数M(5<M<=10000). Output对于每个偶数,输出两个彼此最接近的素数,其和等于该偶数.原创 2015-03-14 14:45:15 · 999 阅读 · 0 评论 -
hdu 1124 Factorial 数论,就是求一个数的阶乘的结果末尾有多少0.
Problem DescriptionThe most important part of a GSM network is so called Base Transceiver Station (BTS). These transceivers form the areas called cells (this term gave the name to the cellular phone) and every phone connects to the BTS with the strongest原创 2015-03-14 15:25:12 · 848 阅读 · 0 评论 -
hdu 2964 Prime Bases 数论~~
Problem DescriptionGiven any integer base b >= 2, it is well known that every positive integer n can be uniquely represented in base b. That is, we can writen = a0 + a1*b + a2*b*b + a3*b*b*b + ... where the coefficients a0, a1, a2, a3, ... are between原创 2015-03-13 17:39:39 · 1035 阅读 · 0 评论 -
hdu 1492 The number of divisors(约数) about Humble Numbers 数论~~
Problem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first 20 humble numbers. Now given a humble number, please w原创 2015-03-12 15:32:41 · 1278 阅读 · 0 评论 -
hdu 2161 Primes 筛法求素数 大水题
Problem DescriptionWrite a program to read in a list of integers and determine whether or not each number is prime. A number, n, is prime if its only divisors are 1 and n. For this problem, the numbers 1 and 2 are not considered primes. InputEach inp原创 2015-03-13 13:48:12 · 1483 阅读 · 0 评论 -
hdu 1220 Cube 简单数论
Problem DescriptionCowl is good at solving math problems. One day a friend asked him such a question: You are given a cube whose edge length is N, it is cut by the planes that was paralleled to its side planes into N * N * N unit cubes. Two unit cubes may原创 2015-03-12 14:27:15 · 995 阅读 · 0 评论 -
hdu 2674 N!Again 数论水题啊~~~
Problem DescriptionWhereIsHeroFrom: Zty, what are you doing ?Zty: I want to calculate N!......WhereIsHeroFrom: So easy! How big N is ?Zty: 1 <=N <=1000000000原创 2015-03-13 15:09:23 · 924 阅读 · 0 评论 -
hdu 1395 2^x mod n = 1 暴力过~~最好学下欧拉定理~~~
Problem DescriptionGive a number n, find the minimum x(x>0) that satisfies 2^x mod n = 1. InputOne positive integer on each line, the value of n. OutputIf the minimum x exists, print a line with 2^x mod n = 1.Print 2^? mod n = 1 otherwise.You原创 2015-03-13 09:27:13 · 1768 阅读 · 1 评论 -
hdu 1071 The area 高数积分求面积~~~~小水题~~
Problem DescriptionIgnatius bought a land last week, but he didn't know the area of the land because the land is enclosed by a parabola and a straight line. The picture below shows the area. Now given all the intersectant points shows in the picture, can原创 2015-03-10 18:16:54 · 1338 阅读 · 0 评论 -
hdu 1141 Factstone Benchmark 数论水题,,阶乘用斯特林公式
Problem DescriptionAmtel has announced that it will release a 128-bit computer chip by 2010, a 256-bit computer by 2020, and so on, continuing its strategy of doubling the word-size every ten years. (Amtel released a 64-bit computer in 2000, a 32-bit comp原创 2015-03-11 15:26:00 · 1012 阅读 · 0 评论 -
hdu 4045 Machine scheduling 斯特林数+插板法
Problem DescriptionA Baidu’s engineer needs to analyze and process large amount of data on machines every day. The machines are labeled from 1 to n. On each day, the engineer chooses r machines to process data. He allocates the r machines to no more than原创 2015-05-07 19:16:47 · 1491 阅读 · 0 评论