[백준 파이썬 3036번]링★최대공약수★
2022. 10. 23. 16:01
728x90
반응형
import sys
import math
N = int(sys.stdin.readline())
A=list(map(int,sys.stdin.readline().rstrip().split()))
res = []
a= A[0]
for i in range(1,len(A)):
b = math.gcd(a,A[i])
c = a//b
d = A[i]//b
print('{}/{}'.format(c,d))
728x90
반응형
'Python(백준) > 정수론 및 조합론' 카테고리의 다른 글
[백준 파이썬 2609번]최대공약수와 최소공배수★gcd,lcm★유클리드함수★ (0) | 2022.10.24 |
---|---|
[백준 파이썬 2004번]조합0의 개수★★ (0) | 2022.10.24 |
[백준 파이썬 1037번]약수 (0) | 2022.10.24 |
[백준 파이썬 5086번]배수와 약수 (0) | 2022.10.24 |
[백준 파이썬 2981번]검문★약수구하기 연습★규칙알아내기 (0) | 2022.10.22 |