結果

問題 No.2030 Googol Strings
ユーザー roarisroaris
提出日時 2022-08-06 08:05:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 501 bytes
コンパイル時間 249 ms
コンパイル使用メモリ 87,292 KB
実行使用メモリ 82,604 KB
最終ジャッジ日時 2023-10-14 09:33:02
合計ジャッジ時間 3,993 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
78,128 KB
testcase_01 AC 61 ms
71,448 KB
testcase_02 AC 63 ms
73,748 KB
testcase_03 AC 62 ms
71,256 KB
testcase_04 AC 118 ms
77,864 KB
testcase_05 AC 62 ms
71,188 KB
testcase_06 AC 68 ms
79,240 KB
testcase_07 AC 69 ms
80,712 KB
testcase_08 AC 70 ms
80,640 KB
testcase_09 AC 66 ms
71,484 KB
testcase_10 AC 63 ms
71,336 KB
testcase_11 AC 64 ms
71,448 KB
testcase_12 AC 103 ms
78,148 KB
testcase_13 AC 93 ms
77,416 KB
testcase_14 AC 70 ms
71,188 KB
testcase_15 AC 96 ms
82,604 KB
testcase_16 AC 71 ms
75,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

for _ in range(int(input())):
    x = input()[:-1]
    y = input()[:-1]
    
    if len(x)<len(y):
        y2 = y+y
        s, a = divmod(len(y2), len(x))
        x2 = ''.join([x]*s+[x[:a]])
    else:
        x2 = x+x
        s, a = divmod(len(x2), len(y))
        y2 = ''.join([y]*s+[y[:a]])
    
    if x2==y2:
        if len(x)<len(y):
            print('Y')
        else:
            print('X')
    elif x2<y2:
        print('Y')
    else:
        print('X')
0