結果

問題 No.2030 Googol Strings
ユーザー SidewaysOwlSidewaysOwl
提出日時 2022-08-05 22:28:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 444 ms / 2,000 ms
コード長 676 bytes
コンパイル時間 692 ms
コンパイル使用メモリ 86,740 KB
実行使用メモリ 265,120 KB
最終ジャッジ日時 2023-10-13 23:45:22
合計ジャッジ時間 5,774 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 221 ms
79,008 KB
testcase_01 AC 170 ms
85,572 KB
testcase_02 AC 225 ms
192,212 KB
testcase_03 AC 72 ms
70,904 KB
testcase_04 AC 220 ms
78,808 KB
testcase_05 AC 157 ms
83,088 KB
testcase_06 AC 345 ms
265,120 KB
testcase_07 AC 214 ms
172,896 KB
testcase_08 AC 216 ms
172,980 KB
testcase_09 AC 164 ms
85,668 KB
testcase_10 AC 170 ms
87,812 KB
testcase_11 AC 166 ms
88,492 KB
testcase_12 AC 212 ms
77,896 KB
testcase_13 AC 366 ms
81,856 KB
testcase_14 AC 196 ms
87,448 KB
testcase_15 AC 444 ms
170,396 KB
testcase_16 AC 367 ms
207,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    x = list(input())
    y = list(input())
    nx = len(x)
    ny = len(y)
    def aaa(x,y):
        ny = len(y)
        nx = len(x)
        for i in range(nx):
            x.append(x[i])
        while len(y) < len(x):
            for i in range(ny):
                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