結果

問題 No.2030 Googol Strings
ユーザー AkariAkari
提出日時 2022-08-05 22:17:07
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 1,124 ms / 2,000 ms
コード長 665 bytes
コンパイル時間 130 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 48,132 KB
最終ジャッジ日時 2024-09-15 19:19:29
合計ジャッジ時間 14,971 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import numpy as np






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(2*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