数论
baother0
这个作者很懒,什么都没留下…
展开
-
阶乘中最低位0的个数&二进制表示中最低位1的位置
/***************************问题描述************************** 1. 给定一个整数N,那么N的阶乘N!末尾有多少个0? 2. 求N!的二进制表示中最低位1的位置 *************************************************************/ /*******原创 2013-01-08 20:00:25 · 1220 阅读 · 0 评论 -
辗转相除法
辗转相除法 「辗转相除法」又叫做「欧几里得算法」,是公元前 300 年左右的希腊数学家欧几里得在他的著作《几何原本》提出的.利用这个方法,可以较快地求出两个自然数的最大公因数,即 HCF 或叫做 gcd.最大公约数(greatest common divisor,简写为gcd;或highest common factor,简写为hcf)所谓最大公因数,是指几个数的共有的因数之中最大的一原创 2012-05-20 11:23:01 · 865 阅读 · 0 评论 -
阶乘的零
Descriptionhttp://acm.tzc.edu.cn/acmhome/problemdetail.do?&method=showdetail&id=3654求最小的正整数n,使得n!末尾不少于x个连续的0。Input多组数据,每组数据输入一个整数x(1Output每组数据输出一个整数nSample Input1987Sample Output原创 2013-01-08 09:12:44 · 1124 阅读 · 0 评论 -
Big Number
Big NumberIn 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原创 2013-10-16 10:04:53 · 482 阅读 · 0 评论 -
Leftmost Digit
DescriptionGiven a positive integer N, you should output the leftmost digit of N^N.InputThe input contains several test cases. The first line of the input is a single integer T which is the numb原创 2013-10-21 20:38:57 · 651 阅读 · 0 评论