摘要:
传送门 Here GCD(i,j) means the greatest common divisor of integer i and integer j. For those who have trouble understanding summation notation, the meani 阅读全文
posted @ 2020-11-01 22:50
lipu123
阅读(223)
评论(0)
推荐(0)
摘要:
给你N个整数, 拜托你帮我找找在这些所有的数字中组合可能的最大公约数 (greatest common divisor) Input 第一行输入一个N (1 < N < 100) 表示样例的数量。接下来N行每行有 M (1 < M < 100) 个正整数,请寻找其中的最大公约数.(M不需要你输入) 阅读全文
posted @ 2020-11-01 22:33
lipu123
阅读(94)
评论(0)
推荐(0)
摘要:
设计一个算法,计算出n阶乘中尾部零的个数 样例 11! = 39916800,因此应该返回 2 挑战 O(logN)的时间复杂度 要判断末尾有几个0就是判断可以整除几次10。10的因子有5和2,而在0~9之间5的倍数只有一个,2的倍数相对较多,所以本题也就转换成了求N阶乘中有几个5的倍数。比如10的 阅读全文
posted @ 2020-11-01 22:31
lipu123
阅读(605)
评论(0)
推荐(0)

浙公网安备 33010602011771号