Logo
(追記) (追記ここまで)

23516번 - Least Common Divisor 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 512 MB129805759.375%

문제

A divisor of string $A$ is a string $D$ which can be repeated an integer number of times to obtain $A$. For example, divisors of string "aaaa" are strings "a", "aa", and "aaaa", and divisors of string "ababab" are strings "ab" and "ababab".

Consider two strings $S$ and $T$. Find the shortest of strings which are simultaneously divisors of $S$ and divisors of $T,ドル or determine that there are no such strings.

입력

The first line contains string $S,ドル and the second line contains string $T$. Each of these strings has length from 1ドル$ to 50ドル$ characters, inclusive, and consists only of lowercase English letters.

출력

Print the least common divisor of strings $S$ and $T,ドル or the string "No solution" in case the least common divisor does not exist.

제한

예제 입력 1

abab
ababab

예제 출력 1

ab

예제 입력 2

aaaa
aaaa

예제 출력 2

a

예제 입력 3

abc
de

예제 출력 3

No solution

힌트

출처

Contest > Open Cup > 2018/2019 Season > Stage 17: Grand Prix of Baltic Sea F번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /