結果

問題 No.2030 Googol Strings
ユーザー AkariAkari
提出日時 2022-08-05 22:17:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 689 ms / 2,000 ms
コード長 665 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 10,764 KB
実行使用メモリ 65,168 KB
最終ジャッジ日時 2023-10-13 23:27:11
合計ジャッジ時間 9,892 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 174 ms
32,540 KB
testcase_01 AC 140 ms
31,252 KB
testcase_02 AC 139 ms
30,820 KB
testcase_03 AC 137 ms
29,504 KB
testcase_04 AC 201 ms
32,176 KB
testcase_05 AC 190 ms
30,764 KB
testcase_06 AC 240 ms
32,240 KB
testcase_07 AC 336 ms
33,168 KB
testcase_08 AC 337 ms
33,176 KB
testcase_09 AC 483 ms
31,316 KB
testcase_10 AC 485 ms
31,064 KB
testcase_11 AC 493 ms
31,212 KB
testcase_12 AC 445 ms
32,700 KB
testcase_13 AC 508 ms
32,296 KB
testcase_14 AC 251 ms
31,320 KB
testcase_15 AC 689 ms
32,960 KB
testcase_16 AC 344 ms
65,168 KB
権限があれば一括ダウンロードができます

ソースコード

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