알고리즘/[python] 백준 BOJ
[python] 백준 1850 최대공약수
Alan_Kim
2023. 2. 24. 01:18
728x90
반응형
import sys
input = sys.stdin.readline
a, b= map(int, input().split())
def gcd(a,b):
if b==0:
return a
return gcd(b, a%b)
ans = gcd(a,b)
while ans:
print(1, end='')
ans -= 1
728x90
반응형