
数论
「已注销」
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU-2035 快速幂
求A^B的最后三位数表示的整数。说明:A^B的含义是“A的B次方”Input输入数据包含多个测试实例,每个实例占一行,由两个正整数A和B组成(1<=A,B<=10000),如果A=0, B=0,则表示输入数据的结束,不做处理。Output对于每个测试实例,请输出A^B的最后三位表示的整数,每个输出占一行。Sample Input2 312 667...原创 2019-07-21 11:10:51 · 129 阅读 · 0 评论 -
POJ - 1061 青蛙的约会
两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为了帮助这两只乐观的青蛙,...原创 2019-08-12 21:42:57 · 264 阅读 · 0 评论 -
UVA - 11426 GCD - Extreme (II)
思路:我们令f(n) = gcd(1, n) + gcd(2, n) + ... + gcd(n-1, n)则对应的结果s(n) = f(2) + f(3) + ... + f(n)所以s(n) = s(n-1)+f(n)因此我们只需求出所有的f(n),在递推即可取g(n, i)表示小于n且与n的gcd值等于i的数x的个数(gcd(n, x) = i)则f(n) = ...原创 2019-08-12 21:38:24 · 204 阅读 · 0 评论 -
LightOJ - 1138 Trailing Zeroes (III)
You task is to find minimal natural numberN, so thatN!contains exactlyQzeroes on the trail in decimal notation. As you knowN! = 1*2*...*N. For example, 5! = 120, 120 contains one zero on the tra...原创 2019-08-12 21:18:13 · 212 阅读 · 0 评论 -
LightOj 1197 Help Hanzo (区间筛法)
Amakusa, the evil spiritual leader has captured the beautiful princess Nakururu. The reason behind this is he had a little problem with Hanzo Hattori, the best ninja and the love of Nakururu. After he...原创 2019-08-09 19:15:05 · 283 阅读 · 0 评论 -
Harmonic Number (调和级数)
In mathematics, thenthharmonic number is the sum of the reciprocals of the firstnnatural numbers:In this problem, you are givenn, you have to findHn.InputInput starts with an integerT...原创 2019-08-09 18:03:34 · 707 阅读 · 0 评论 -
Goldbach`s Conjecture (哥德巴赫和素数打表)
Goldbach's conjecture is one of the oldest unsolved problems in number theory and in all of mathematics. It states:Every even integer, greater than 2, can be expressed as the sum of two primes [1]....原创 2019-08-09 17:55:15 · 777 阅读 · 0 评论 -
LightOJ - 1282 Leading and Trailing(前三位和后三位)
You are given two integers:nandk, your task is to find the most significant three digits, and least significant three digits ofnk.InputInput starts with an integerT (≤ 1000), denoting the num...原创 2019-08-09 17:40:58 · 256 阅读 · 0 评论 -
LightOJ 1341 Aladdin and the Flying Carpet
It's said that Aladdin had to solve seven mysteries before getting the Magical Lamp which summons a powerful Genie. Here we are concerned about the first mystery.Aladdin was about to enter to a magi...原创 2019-08-09 17:29:18 · 226 阅读 · 0 评论 -
LightOJ 1220 Mysterious Bacteria (唯一分解定理和素数打表)
Dr. Mob has just discovered a Deathly Bacteria. He named it RC-01. RC-01 has a very strange reproduction system. RC-01 lives exactlyxdays. Now RC-01 produces exactlypnew deadly Bacteria wherex = b...原创 2019-08-09 17:19:37 · 252 阅读 · 0 评论 -
LightOJ 1370 Bi-shoe and Phi-shoe (欧拉函数)
Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He needs some bamboos for his students, so he asked his assistant Bi-Shoe to go...原创 2019-08-09 17:06:28 · 189 阅读 · 0 评论 -
hdu 2674(N!Again)
WhereIsHeroFrom: Zty, what are you doing ?Zty: I want to calculate N!......WhereIsHeroFrom: So easy! How big N is ?Zty:...原创 2019-08-13 17:19:01 · 225 阅读 · 0 评论 -
Lightoj 1090 - Trailing Zeroes (II)
Find the number of trailing zeroes for the following function:nCr* pqwheren, r, p, qare given. For example, ifn = 10, r = 4, p = 1, q = 1, then the number is210so, number of trailing zeroes ...原创 2019-08-13 17:16:22 · 224 阅读 · 0 评论 -
HDU-4497 GCD and LCM
Given two positive integers G and L, could you tell me how many solutions of (x, y, z) there are, satisfying that gcd(x, y, z) = G and lcm(x, y, z) = L?Note, gcd(x, y, z) means the greatest common d...原创 2019-08-13 17:09:08 · 244 阅读 · 0 评论 -
数论知识
中国剩余定理:https://blog.youkuaiyun.com/qq_40772692/article/details/81872831扩展中国剩余定理:https://www.cnblogs.com/xiefengze1/p/10350652.html数论题目:https://blog.youkuaiyun.com/Soul_97/article/details/87904163...原创 2019-08-13 16:38:13 · 163 阅读 · 0 评论