上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 20 下一页
摘要: 欧拉函数是指 对正整数n,小于或等于n的数中与n互质的数的数目。 有如下公式: 其中pi为x的质因数(无重复),x不为0 欧拉函数是积性函数——若m,n互质,φ(mn)=φ(m)φ(n)。 特殊性质:当n为奇数时,φ(2n)=φ(n) 欧拉公式的延伸:一个数的所有质因子之和是euler(n)*n/2 欧拉函数还有这样的性质: 设a为N的质因数,若(N % a == 0 && (N / a) % ... 阅读全文
posted @ 2017-01-15 14:21 Pic 阅读(1300) 评论(0) 推荐(1) 编辑
摘要: 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 has... 阅读全文
posted @ 2017-01-14 17:00 Pic 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 素数(质数)的判定 (1)最基本素数判定方法大家熟悉,只用看看2到n(或n的平方根)之间有没有n的约数: #include void main() { int i,n; scanf("%d",&n); for(i=2;i int n,i,j,a[1000001],p[100000],t=0; void main() { scanf("%d",&... 阅读全文
posted @ 2017-01-14 16:48 Pic 阅读(236) 评论(0) 推荐(0) 编辑
摘要: Problem Description Have you ever played quoit in a playground? Quoit is a game in which flat rings are pitched at some toys, with all the toys encircled awarded.In the field of Cyberground, the posit... 阅读全文
posted @ 2017-01-14 15:15 Pic 阅读(287) 评论(0) 推荐(0) 编辑
摘要: Problem Description 老师在计算几何这门课上给Eddy布置了一道题目,题目是这样的:给定二维的平面上n个不同的点,要求在这些点里寻找三个点,使他们构成的三角形拥有的面积最大。Eddy对这道题目百思不得其解,想不通用什么方法来解决,因此他找到了聪明的你,请你帮他解决这个题目。 Input 输入数据包含多组测试用例,每个测试用例的第一行包含一个整数n,表示一共有n个互不相同的点... 阅读全文
posted @ 2017-01-13 21:10 Pic 阅读(283) 评论(0) 推荐(0) 编辑
摘要: Problem Description WisKey的眼镜有500多度,所以眼神不大好,而且他有个习惯,就是走路喜欢看着地(不是为了拣钱哦^_^),所以大家下次碰见他的时候最好主动打下招呼,呵呵.但是Rabbit总是喜欢扮神秘,一天WisKey去食堂排队等着买饭,突然收到一道短消息,是Rabbit发的,”呵呵,又看见你了,你没看到我吧”.WisKey马上拉长脖子扫描食堂,可是就是看不到,再发短信... 阅读全文
posted @ 2017-01-13 10:57 Pic 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Problem Description 在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗? Input 输入包括多组数据。每组数据第一行是两个整数N、M(N #include #include #include #include #inclu... 阅读全文
posted @ 2017-01-13 09:33 Pic 阅读(153) 评论(0) 推荐(0) 编辑
摘要: B. New Year and North Pole time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output In this problem we assume the Earth to be a completely round ba... 阅读全文
posted @ 2016-12-31 17:38 Pic 阅读(188) 评论(0) 推荐(0) 编辑
摘要: A. New Year and Hurry time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Limak is going to participate in a contest on the last day o... 阅读全文
posted @ 2016-12-31 17:29 Pic 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 今天在刷题过程中发现了一个特别奇怪的现象,printf() 的精度控制不是按照4舍5入,而是按照5舍6入, 例如: printf("%.2f\n",0.145) printf("%.2f\n",0.146) 结果分别为 0.14 0.15 随后的实验中,有一个更加奇怪的现象 printf("%.2f\n",0.155) 的结果为 0.16 这就很是奇怪了,一会四舍五入,一会五舍六入的。。。。。 ... 阅读全文
posted @ 2016-12-30 17:54 Pic 阅读(1099) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 20 下一页