
1条回答 默认 最新
关注import math def num_type(n): s = 1 for i in range(2, int(math.sqrt(n)) + 1): if n % i == 0: s += i j = n // i if j != i: s += j if s < n: return -1 elif s > n: return 1 else: return 0 n, m = [int(x) for x in input().split(" ")] counts = [0, 0, 0] for i in range(n, m): result = num_type(i) counts[result + 1] += 1 print(counts)本回答被题主选为最佳回答 , 对您是否有帮助呢?评论 打赏 举报解决 1无用