結果

問題 No.2030 Googol Strings
ユーザー ShirotsumeShirotsume
提出日時 2022-07-10 01:57:43
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 714 bytes
コンパイル時間 712 ms
コンパイル使用メモリ 87,240 KB
実行使用メモリ 85,688 KB
最終ジャッジ日時 2023-08-30 10:50:40
合計ジャッジ時間 3,785 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
77,880 KB
testcase_01 AC 78 ms
71,244 KB
testcase_02 AC 77 ms
72,792 KB
testcase_03 AC 72 ms
71,280 KB
testcase_04 WA -
testcase_05 AC 87 ms
76,012 KB
testcase_06 AC 99 ms
81,784 KB
testcase_07 AC 112 ms
85,688 KB
testcase_08 AC 113 ms
85,684 KB
testcase_09 AC 101 ms
76,000 KB
testcase_10 AC 101 ms
75,880 KB
testcase_11 AC 102 ms
76,032 KB
testcase_12 AC 133 ms
77,784 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 109 ms
78,696 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
    p = 1
    while len(t) >= p * len(s):
        p += 1
    s = s * p
    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