题解 | #最简真分数#
最简真分数
https://www.nowcoder.com/practice/1f1db273eeb745c6ac83e91ff14d2ec9
def gcd(a, b): while b: a, b = b, a % b return a while True: try: n = int(input()) s = input().split(" ") num = [] for i in range(len(s)): num.append(int(s[i])) sum = 0 for j in range(len(s)): for k in range(j, len(s)): if gcd(num[j], num[k]) == 1 and j != k: sum = sum + 1 print(sum) except: break