
最大公约数
文章平均质量分 69
w1997t
ACM:从入门到入土
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
暑期集训之最大公约数问题
There is a hill with n holes around. The holes are signed from 0 to n-1. A rabbit must hide in one of the holes. A wolf searches the rabbit in anticlockwise order. The first hole he get into转载 2017-07-21 19:24:35 · 301 阅读 · 0 评论 -
暑期集训之cake
一次生日Party可能有p人或者q人参加,现准备有一个大蛋糕.问最少要将蛋糕切成多少块(每块大小不一定相等),才能使p人或者q人出席的任何一种情况,都能平均将蛋糕分食. Input每行有两个数p和q. Output输出最少要将蛋糕切成多少块. Sample Input2 3Sample Output4 Hint将蛋糕转载 2017-07-21 20:58:22 · 258 阅读 · 0 评论 -
暑期集训之又见GCD
有三个正整数a,b,c(0Input第一行输入一个n,表示有n组测试数据,接下来的n行,每行输入两个正整数a,b。 Output输出对应的c,每组测试数据占一行。 Sample Input26 212 4Sample Output48这道题其实是一道关于最大公约数的,数据不大正常暴力求解就能AC,虽然学长说过有数学方法,不过还是没听懂,还是暴力解出原创 2017-07-21 22:13:37 · 277 阅读 · 0 评论