| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 66912 | 胡海峰老师 | 最简真分数 | Python3 | Runtime Error | 4030 MS | 3792 KB | 493 | 2024-03-11 15:36:59 |
""" input 7 3 5 7 9 11 13 15 output 17 """ def max_common_divisor(x,y): if x<y: x,y = y,x t = y while t!=1: if x%t==0 and y%t==0: break t -=1 return t n = int(input()) a = list(map(int,input().split())) a.sort() cnt =0 for i in range(n-1): for j in range(i+1,n): ai = a[i] aj = a[j] if max_common_divisor(ai,aj)==1: #print( f"{ai}/{aj}") cnt +=1 print(cnt)
Runtime Error:[ERROR] A not allowed system call. Call ID:511