結果

問題 No.2030 Googol Strings
ユーザー SidewaysOwlSidewaysOwl
提出日時 2022-08-05 22:20:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 599 bytes
コンパイル時間 1,090 ms
コンパイル使用メモリ 87,348 KB
実行使用メモリ 184,904 KB
最終ジャッジ日時 2023-10-13 23:33:24
合計ジャッジ時間 5,269 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 171 ms
78,036 KB
testcase_01 AC 109 ms
79,512 KB
testcase_02 AC 136 ms
123,848 KB
testcase_03 AC 65 ms
71,344 KB
testcase_04 WA -
testcase_05 AC 109 ms
79,328 KB
testcase_06 AC 200 ms
184,904 KB
testcase_07 AC 202 ms
173,128 KB
testcase_08 AC 203 ms
173,056 KB
testcase_09 AC 105 ms
79,352 KB
testcase_10 AC 106 ms
79,660 KB
testcase_11 AC 103 ms
80,064 KB
testcase_12 AC 164 ms
78,008 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 246 ms
159,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    x = list(input())
    y = list(input())
    nx = len(x)
    ny = len(y)
    def aaa(x,y):
        n = len(y)
        while len(y) < len(x):
            for i in range(n):
                y.append(y[i])
    if len(x) > len(y):aaa(x,y)
    elif len(y) > len(x):aaa(y,x)
    n = min(len(x),len(y))
    cnt = 0
    for i in range(n):
        cnt += x[i] == y[i]
    if cnt != n:
        if x > y:
            print("X")
        elif x < y:
            print("Y")
    else:
        if nx > ny:
            print("X")
        else:
            print("Y")
#     print(x,y)
0