![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
GCD||LCM
文章平均质量分 64
reb0rn初代
弃疗吧
展开
-
Wolf and Rabbit
Description 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 h原创 2016-07-20 10:05:19 · 299 阅读 · 0 评论 -
又见GCD
#include int GCD(int a,int b) { if(a%b==0) return b; else return GCD(b,a%b); } int main() { int n,a,b,c,i,k; scanf("%d\n",&n); while(n--) { scanf("%d %d",&a,&b); c = 2*b原创 2016-07-20 11:24:26 · 197 阅读 · 0 评论 -
Cake
Description 一次生日Party可能有p人或者q人参加,现准备有一个大蛋糕.问最少要将蛋糕切成多少块(每块大小不一定相等),才能使p人或者q人出席的任何一种情况,都能平均将蛋糕分食. Input 每行有两个数p和q. Output 输出最少要将蛋糕切成多少块. Sample Inp原创 2016-07-20 17:19:58 · 211 阅读 · 0 评论