結果

問題 No.2030 Googol Strings
ユーザー AkariAkari
提出日時 2022-08-05 22:13:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 645 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 10,892 KB
実行使用メモリ 11,948 KB
最終ジャッジ日時 2023-10-13 23:20:06
合計ジャッジ時間 3,806 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
11,212 KB
testcase_01 AC 19 ms
9,804 KB
testcase_02 AC 19 ms
9,484 KB
testcase_03 AC 16 ms
7,772 KB
testcase_04 WA -
testcase_05 AC 68 ms
9,484 KB
testcase_06 AC 119 ms
10,896 KB
testcase_07 AC 220 ms
11,860 KB
testcase_08 AC 217 ms
11,920 KB
testcase_09 AC 160 ms
10,068 KB
testcase_10 AC 161 ms
10,104 KB
testcase_11 AC 165 ms
10,036 KB
testcase_12 AC 169 ms
11,316 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 217 ms
11,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys







def main():
    t = int(input())
    Q = sys.stdin.read().split()
    for qi in range(t):
        X = Q[2*qi]
        Y = Q[2*qi+1]
        nx, ny = len(X), len(Y)
        ok = False
        for i in range(max(nx, ny)):
            xi = i if i < nx else i % nx
            yi = i if i < ny else i % ny
            if X[xi] > Y[yi]:
                print('X')
                ok = True
            elif X[xi] < Y[yi]:
                print('Y')
                ok = True
            else:
                continue
            break
        if not ok: print('X' if nx > ny else 'Y')









if __name__ == '__main__':
    main()
0