SOLUTION INFO
Python · main.py
import sys
def input():
return sys.stdin.readline().rstrip()
def GCD(x,y):
if y == 0:
return x
else:
return GCD(y, x%y)
s = input()
t = input()
gcd = GCD(len(s),len(t))
lcm = len(s) * len(t) // gcd
s = s * (lcm // len(s))
t = t * (lcm // len(t))
if s == t:
print(1)
else:
print(0)
SOLUTION DESCRIPTION
풀이 설명
등록된 풀이 설명이 없습니다.
DISCUSSION
댓글
GitHub 로그인 후 작성할 수 있으며 모든 댓글은 이 저장소의 Discussions에 보관됩니다.