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
반응형
'알고리즘 > [python] 백준 BOJ' 카테고리의 다른 글
[python] 백준 18352 특정 거리의 도시 찾기 (0) | 2023.02.26 |
---|---|
[python] 백준 1033 칵테일 (2) | 2023.02.24 |
[python] 백준 11689 GCD(n, k) = 1 (0) | 2023.02.24 |
[python] 백준 1747 소수&팰린드롬 (0) | 2023.02.23 |
[python] 백준 1456 거의 소수 (0) | 2023.02.23 |
댓글