結果

問題 No.2030 Googol Strings
ユーザー Shirotsume
提出日時 2022-07-06 00:36:06
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 315 bytes
コンパイル時間 646 ms
コンパイル使用メモリ 82,248 KB
実行使用メモリ 844,568 KB
最終ジャッジ日時 2024-12-17 14:52:18
合計ジャッジ時間 7,979 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 6 RE * 8 TLE * 1 MLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
def solve():
  x=input()
  y=input()
  n = len(x)
  m = len(y)
  if x + y == y + x:
    if n > m:
      print('X')
    else:
      print('Y')
    return
  lcm = n * m // gcd(n, m)
  x *= lcm
  y *= lcm
  if x > y:
    print('X')
  else:
    print('Y')



for _ in range(int(input())):
  solve()
0