結果

問題 No.2030 Googol Strings
ユーザー ShirotsumeShirotsume
提出日時 2022-07-10 01:59:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 720 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 86,740 KB
最終ジャッジ日時 2023-08-30 10:52:38
合計ジャッジ時間 3,625 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
77,760 KB
testcase_01 AC 76 ms
71,148 KB
testcase_02 AC 78 ms
73,296 KB
testcase_03 AC 74 ms
71,340 KB
testcase_04 WA -
testcase_05 AC 89 ms
75,804 KB
testcase_06 AC 100 ms
82,444 KB
testcase_07 AC 110 ms
86,688 KB
testcase_08 AC 111 ms
86,740 KB
testcase_09 AC 99 ms
75,888 KB
testcase_10 AC 100 ms
76,152 KB
testcase_11 AC 101 ms
76,240 KB
testcase_12 AC 133 ms
77,588 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 109 ms
79,288 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 + 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