結果

問題 No.2030 Googol Strings
ユーザー lilictakalilictaka
提出日時 2022-08-10 13:17:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 558 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 81,744 KB
実行使用メモリ 167,596 KB
最終ジャッジ日時 2023-10-20 23:11:24
合計ジャッジ時間 3,596 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 163 ms
76,956 KB
testcase_01 AC 60 ms
71,452 KB
testcase_02 AC 73 ms
89,544 KB
testcase_03 AC 38 ms
53,484 KB
testcase_04 WA -
testcase_05 AC 65 ms
75,700 KB
testcase_06 AC 124 ms
132,820 KB
testcase_07 AC 169 ms
167,596 KB
testcase_08 AC 170 ms
167,596 KB
testcase_09 AC 79 ms
75,816 KB
testcase_10 AC 85 ms
75,912 KB
testcase_11 AC 80 ms
76,164 KB
testcase_12 AC 155 ms
76,728 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 124 ms
106,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
def cmp(A,B):#len(A) > len(B)
    for i in range(len(A)):
        if A[i] > B[i % len(B)]:
            return 1
        elif A[i] < B[i%len(B)]:
            return -1
    return 1

for _ in range(T):
    X = list(input())
    Y = list(input())
    if len(X) == len(Y):
        if X > Y:
            print('X')
        else:
            print('Y')
    elif len(X) > len(Y):
        if cmp(X,Y) == 1:
            print('X')
        else:print('Y')
    else:
        if cmp(Y,X) == 1:
            print('Y')
        else:
            print('X')
0