数论
文章平均质量分 79
暮雨rainy
这个作者很懒,什么都没留下…
展开
-
TOJ 3863.Right Triangle(勾股数)
题目链接:http://acm.tju.edu.cn/toj/showp3863.html3863. Right TriangleTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 846 Accepted Runs: 259When Ant studied in middle sc原创 2016-08-15 16:02:17 · 613 阅读 · 0 评论 -
TOJ 3976.Change(dp或找规律)
题目链接:http://acm.tju.edu.cn/toj/showp3976.html3976. ChangeTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 530 Accepted Runs: 244After Shawn sees the following原创 2016-08-11 23:12:21 · 281 阅读 · 0 评论 -
TOJ 1777.Factstone Benchmark(取对数)
题目链接:http://acm.tju.edu.cn/toj/showp1777.html1777. Factstone BenchmarkTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 692 Accepted Runs: 402Amtel has announced th原创 2016-08-24 17:43:38 · 242 阅读 · 0 评论 -
TOJ 3259.Mysterious Number(埃式筛法)
题目链接:http://acm.tju.edu.cn/toj/showp3259.html3259. Mysterious NumberTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 1356 Accepted Runs: 435Mysterious Number ref原创 2016-08-12 17:53:13 · 310 阅读 · 0 评论 -
埃式筛法
埃氏筛或爱氏筛,是一种公元前250年由古希腊数学家埃拉托斯特尼所提出的一种简单检定素数的算法。给出要筛数值的范围n,找出以内的素数。先用2去筛,即把2留下,把2的倍数剔除掉;再用下一个质数,也就是3筛,把3留下,把3的倍数剔除掉;接下去用下一个质数5筛,把5留下,把5的倍数剔除掉;不断重复下去。见下图:一、利用埃式筛法打印质数:首先是自己写的,一点都不优雅:原创 2016-08-12 21:55:53 · 931 阅读 · 0 评论 -
TOJ 1179.Game of Connections(大数模板)
题目链接:http://acm.tju.edu.cn/toj/showp1179.html1179. Game of ConnectionsTime Limit: 2.0 Seconds Memory Limit: 65536KTotal Runs: 467 Accepted Runs: 205This is a small but转载 2016-08-25 16:04:00 · 247 阅读 · 0 评论 -
TOJ 3845.Cut Stick(斐波那契)
题目链接:http://acm.tju.edu.cn/toj/showp3845.html3845. Cut StickTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 546 Accepted Runs: 259Ann meets another problem.Si原创 2016-08-13 20:34:11 · 424 阅读 · 0 评论 -
TOJ 3861.Erase
题目链接:http://acm.tju.edu.cn/toj/showp3861.html3861. EraseTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 392 Accepted Runs: 212Ann is playing a number game with原创 2016-08-14 17:09:07 · 241 阅读 · 0 评论 -
TOJ 1859.Goldbach's Conjecture
题目链接:http://acm.tju.edu.cn/toj/showp1859.html1859. Goldbach's ConjectureTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 2172 Accepted Runs: 763Goldbach's Conjectu原创 2016-09-08 21:56:23 · 258 阅读 · 0 评论 -
TOJ 3293.A Sequence of Numbers(快速幂取余)
题目链接:http://acm.tju.edu.cn/toj/showp3293.html3293. A Sequence of NumbersTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 1195 Accepted Runs: 343Xinlv wrote some se原创 2016-12-10 00:27:50 · 359 阅读 · 0 评论 -
3288.Stockholm Numbers(注意结论)
题目链接:http://acm.tju.edu.cn/toj/showp3288.html这道题有个结论就是:如果k含有偶数个1,即k是这种数,那么第k个这种数是它的2倍;否则,是k的2倍+1知道这个结论就很好写了:#includeusing namespace std;int main(){ int num; scanf("%d",&num原创 2016-12-10 00:34:25 · 322 阅读 · 0 评论 -
TOJ 3384.sun and moon [Chinese]
题目链接:http://acm.tju.edu.cn/toj/showp3384.html邂逅明下Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4570 Accepted Submission(s): 2原创 2017-07-09 11:36:41 · 249 阅读 · 0 评论 -
TOJ 3772.Rupxup's Math Problem
题目链接:http://acm.tju.edu.cn/toj/showp3772.htmlDescriptionRupxup has learned a new function called function "F(n)", where F(n) equals to the number of factors of n (including 1 and n). For转载 2017-07-31 20:48:50 · 346 阅读 · 0 评论 -
TOJ 1753.Hamming Problem
题目链接:http://acm.tju.edu.cn/toj/showp1753.html1753. Hamming ProblemTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 535 Accepted Runs: 251 Multiple test filesF原创 2016-08-23 23:37:09 · 242 阅读 · 0 评论 -
TOJ 1399.Blocks
题目链接:http://acm.tju.edu.cn/toj/showp1399.html1399. BlocksTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 370 Accepted Runs: 236Donald wishes to send a gift to his原创 2016-08-22 17:40:11 · 278 阅读 · 0 评论 -
TOJ 3313.Calculation(欧拉函数、费马定理)
from:http://qianmacao.blog.163.com/blog/static/203397180201231241352912/欧拉函数phi(m):当m>1是,phi(m)表示比m小且与m互质的正整数个数1、费马定理:a的p-1次方mod p余1。(其中p是素数,a是不能被p整除的正整数。2、欧拉定理 2.1 欧拉函数(RSA的证明用到)转载 2016-09-12 18:55:48 · 652 阅读 · 0 评论 -
TOJ 3990.I guess the gift is a bag! II(质因数、欧拉函数好题)
题目链接 : http://acm.tju.edu.cn/toj/showp3990.html Coach Yu has lots of bags, every bag has its number. And what is more, he wants to send these bags to acm team-member. But he requires that if you get原创 2016-07-20 13:09:02 · 351 阅读 · 0 评论 -
TOJ 3001.Score [Chinese]
题目链接 : http://acm.tju.edu.cn/toj/showp3990.html http://acm.hdu.edu.cn/showproblem.php?pid=2534 大家都知道,pfz是“成电杰出学生”,在成电杰出学生的颁奖典礼上,lxh和pfz都没有听台上在说什么,而是在下面讨论当晚的美式足球比赛,lxh预测说纽约巨人队今晚将会得到11分,pfz马上说不可能。因为原创 2016-07-20 22:13:47 · 305 阅读 · 0 评论 -
TOJ 2996.Shot(数学+物理计算)
题目链接 : http://acm.tju.edu.cn/toj/showp2996.html Description “Superman” Howard in the NBA slam dunk contest asked to increase the height of the rim to perform slam dunk, but has not been approved原创 2016-07-21 22:16:53 · 322 阅读 · 0 评论 -
TOJ 2793.A Simple Problem
题目链接:http://acm.tju.edu.cn/toj/showp2793.html2793. A Simple ProblemTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 554 Accepted Runs: 266Given a nonnegative integ原创 2016-08-16 21:51:50 · 393 阅读 · 0 评论 -
TOJ 1407. Paths on a Grid(组合数)
题目链接:http://acm.tju.edu.cn/toj/showp1407.html1407. Paths on a GridTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 3485 Accepted Runs: 756Imagine you are attending原创 2016-08-17 11:06:42 · 304 阅读 · 0 评论 -
TOJ 1987.Faulty Odometer(数论题)
题目链接:http://acm.tju.edu.cn/toj/showp1987.html1987. Faulty OdometerTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 596 Accepted Runs: 399You are given a car odomet原创 2016-08-19 17:35:52 · 350 阅读 · 0 评论 -
TOJ 1868.Count the factors(埃式筛法)
题目链接:http://acm.tju.edu.cn/toj/showp1868.html1868. Count the factorsTime Limit: 0.5 Seconds Memory Limit: 65536KTotal Runs: 2691 Accepted Runs: 855The ProblemWrite a原创 2016-08-20 15:24:48 · 244 阅读 · 0 评论 -
TOJ 1082.Ride to School
题目链接:http://acm.tju.edu.cn/toj/showp1082.html1082. Ride to SchoolTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 823 Accepted Runs: 402Many graduate students of原创 2016-08-20 18:31:16 · 286 阅读 · 0 评论 -
欧拉函数
最近做acm遇到几道互质的题,也就是欧拉函数的运用,所以就记录下来,大多都是抄来的,请见谅。。。欧拉函数在数论,对正整数n,欧拉函数是少于或等于n的数中与n互质的数的数目。此函数以其首名研究者欧拉命名,它又称为Euler’s totient function、φ函数、欧拉商数等。 例如φ(8)=4,因为1,3,5,7均和8互质。 从欧拉函数引伸出来在环论方面的事实和拉格朗日定理构成了欧拉定理的证明。原创 2016-08-09 17:19:54 · 231 阅读 · 0 评论 -
TOJ 1395.Relatives
题目链接 : http://acm.tju.edu.cn/toj/showp1395.html Given n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are n原创 2016-08-09 17:23:57 · 281 阅读 · 0 评论 -
TOJ 1301.The Trip(精度题)
题目链接:http://acm.tju.edu.cn/toj/showp1301.html1301. The TripTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 1989 Accepted Runs: 481 Multiple test filesA num原创 2016-08-21 15:50:24 · 216 阅读 · 0 评论 -
TOJ 2226.Parliament
题目链接:http://acm.tju.edu.cn/toj/showp2226.html2226. ParliamentTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 244 Accepted Runs: 115 Multiple test filesNew conv原创 2016-09-01 02:12:49 · 481 阅读 · 0 评论 -
TOJ 3519.Ones and Zeros
题目链接:http://acm.tju.edu.cn/toj/showp3519.html3519. Ones and ZerosTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 702 Accepted Runs: 395Though numbers are create原创 2017-07-29 10:07:01 · 370 阅读 · 0 评论