結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 158 ms
76,812 KB
testcase_01 AC 53 ms
71,308 KB
testcase_02 AC 70 ms
89,392 KB
testcase_03 AC 35 ms
53,344 KB
testcase_04 AC 156 ms
76,828 KB
testcase_05 AC 70 ms
75,620 KB
testcase_06 AC 125 ms
132,672 KB
testcase_07 AC 167 ms
167,456 KB
testcase_08 AC 169 ms
167,456 KB
testcase_09 AC 106 ms
75,928 KB
testcase_10 AC 105 ms
75,964 KB
testcase_11 AC 108 ms
76,048 KB
testcase_12 AC 183 ms
76,564 KB
testcase_13 AC 177 ms
77,616 KB
testcase_14 AC 82 ms
75,368 KB
testcase_15 AC 167 ms
92,196 KB
testcase_16 AC 143 ms
111,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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