結果

問題 No.2030 Googol Strings
ユーザー lilictakalilictaka
提出日時 2022-08-10 13:10:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 523 bytes
コンパイル時間 408 ms
コンパイル使用メモリ 81,816 KB
実行使用メモリ 167,632 KB
最終ジャッジ日時 2023-10-20 22:57:16
合計ジャッジ時間 5,903 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 38 ms
53,520 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 127 ms
145,312 KB
testcase_07 AC 178 ms
167,632 KB
testcase_08 AC 181 ms
167,632 KB
testcase_09 AC 73 ms
76,520 KB
testcase_10 AC 78 ms
77,444 KB
testcase_11 AC 74 ms
77,124 KB
testcase_12 AC 182 ms
76,780 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 148 ms
128,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
def cmp(A,B):
    for i in range(min(len(A),len(B))):
        if A[i] < B[i]:
            return True
    return False
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):
        nY = Y + Y
        if cmp(X,nY):
            print('Y')
        else:
            print('X')
    else:
        if cmp(Y,X + X):
            print('X')
        else:
            print('Y')
0