結果

問題 No.2030 Googol Strings
ユーザー ShirotsumeShirotsume
提出日時 2022-07-10 01:45:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 693 bytes
コンパイル時間 664 ms
コンパイル使用メモリ 86,768 KB
実行使用メモリ 82,000 KB
最終ジャッジ日時 2023-08-30 10:36:14
合計ジャッジ時間 6,225 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 143 ms
78,136 KB
testcase_01 AC 75 ms
71,352 KB
testcase_02 AC 74 ms
71,892 KB
testcase_03 AC 71 ms
71,352 KB
testcase_04 WA -
testcase_05 AC 85 ms
75,872 KB
testcase_06 AC 93 ms
80,324 KB
testcase_07 AC 106 ms
81,712 KB
testcase_08 AC 109 ms
82,000 KB
testcase_09 AC 96 ms
75,728 KB
testcase_10 AC 97 ms
75,744 KB
testcase_11 AC 98 ms
75,828 KB
testcase_12 AC 129 ms
77,752 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 104 ms
78,048 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):
        p = 1
        while len(s) > p * len(t):
            p += 1
        t = t * p
    else:
        ans = 'Y'
        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