GCD&&LCM
hpuw1234
这个作者很懒,什么都没留下…
展开
-
最小公倍数 (lcm)【HDU】-1108
点击打开链接最小公倍数Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 57536 Accepted Submission(s): 31980Problem Description给定两个正整数,计算这两原创 2017-08-08 17:26:55 · 317 阅读 · 0 评论 -
gcd公式
求最大公约数:1.迭代实现int gcd(int a,intb){ while(b!=0) { int r=b; b=a%b; a=r; } return a;}2.递归实现int gcd(int a,int b){ if(b==0) return a; ret原创 2017-08-05 19:10:25 · 1340 阅读 · 0 评论 -
Wolf and Rabbit (GCD)【HDU】-1222
http://acm.hdu.edu.cn/showproblem.php?pid=1222 Wolf and RabbitTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)原创 2017-07-27 22:48:56 · 248 阅读 · 0 评论 -
又见GCD(GCD)【HDU】-2504
点击打开链接又见GCDTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 19990 Accepted Submission(s): 8355Problem Description有三个正整数a,b,c(0原创 2017-08-05 20:34:42 · 196 阅读 · 0 评论 -
cake (gcd)【HDU】-1722
点击打开链接CakeTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4994 Accepted Submission(s): 2495Problem Description一次生日Party可能有p人或原创 2017-08-05 19:26:52 · 241 阅读 · 0 评论