結果

問題 No.2030 Googol Strings
ユーザー ShirotsumeShirotsume
提出日時 2022-07-10 01:57:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 150 ms / 2,000 ms
コード長 724 bytes
コンパイル時間 525 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 85,720 KB
最終ジャッジ日時 2023-08-30 10:49:37
合計ジャッジ時間 4,022 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
77,812 KB
testcase_01 AC 79 ms
71,416 KB
testcase_02 AC 77 ms
73,816 KB
testcase_03 AC 72 ms
71,316 KB
testcase_04 AC 123 ms
78,028 KB
testcase_05 AC 86 ms
75,952 KB
testcase_06 AC 98 ms
83,996 KB
testcase_07 AC 112 ms
85,720 KB
testcase_08 AC 112 ms
85,712 KB
testcase_09 AC 112 ms
76,336 KB
testcase_10 AC 114 ms
76,072 KB
testcase_11 AC 112 ms
76,044 KB
testcase_12 AC 146 ms
77,616 KB
testcase_13 AC 150 ms
77,504 KB
testcase_14 AC 96 ms
75,992 KB
testcase_15 AC 136 ms
79,672 KB
testcase_16 AC 110 ms
80,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
INF = 2 ** 63 - 1
mod = 998244353

def solve():
    s = input()
    t = input()
    n = len(s)
    m = len(t)
    p = 1
    while len(s) > p * len(t):
        p += 1
    t = t * (p + 1)
    p = 1
    while len(t) > p * len(s):
        p += 1
    s = s * (p + 1)
    for i in range(min(len(s), len(t))):
        if s[i] > t[i]:
            ans = 'X'
            break
        elif s[i] < t[i]:
            ans = 'Y'
            break
    else:
        if n < m:
            ans = 'Y'
        else:
            ans = 'X'

    print(ans)

for _ in range(ii()):
    solve()
        
0