結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
78,104 KB
testcase_01 AC 73 ms
71,048 KB
testcase_02 AC 74 ms
72,696 KB
testcase_03 AC 71 ms
70,892 KB
testcase_04 WA -
testcase_05 AC 86 ms
75,852 KB
testcase_06 AC 97 ms
81,276 KB
testcase_07 AC 107 ms
82,652 KB
testcase_08 AC 106 ms
82,676 KB
testcase_09 AC 97 ms
75,844 KB
testcase_10 AC 97 ms
75,764 KB
testcase_11 AC 98 ms
75,832 KB
testcase_12 AC 134 ms
77,580 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 105 ms
78,332 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()
    ans = 'X'
    if len(s) < len(t):
        ans = 'Y'
    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
    print(ans)

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