結果

問題 No.2030 Googol Strings
ユーザー EguyEguy
提出日時 2022-08-05 22:22:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 213 ms / 2,000 ms
コード長 549 bytes
コンパイル時間 416 ms
コンパイル使用メモリ 87,264 KB
実行使用メモリ 81,912 KB
最終ジャッジ日時 2023-10-13 23:36:15
合計ジャッジ時間 4,012 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
77,596 KB
testcase_01 AC 75 ms
71,192 KB
testcase_02 AC 73 ms
71,876 KB
testcase_03 AC 73 ms
71,496 KB
testcase_04 AC 118 ms
77,584 KB
testcase_05 AC 97 ms
76,888 KB
testcase_06 AC 94 ms
80,628 KB
testcase_07 AC 108 ms
81,912 KB
testcase_08 AC 107 ms
81,788 KB
testcase_09 AC 180 ms
76,692 KB
testcase_10 AC 179 ms
76,716 KB
testcase_11 AC 185 ms
76,948 KB
testcase_12 AC 193 ms
78,024 KB
testcase_13 AC 193 ms
77,780 KB
testcase_14 AC 109 ms
76,880 KB
testcase_15 AC 213 ms
77,564 KB
testcase_16 AC 131 ms
78,180 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, math
sys.setrecursionlimit(1000000)
INF = 1 << 100
#mod = 1000000007
mod = 998244353
input = lambda: sys.stdin.readline().rstrip()
li = lambda: list(map(int, input().split()))

T = int(input())

out = []
for _ in range(T):
    X = input()
    Y = input()
    N, M = len(X), len(Y)
    A = max(N, M)
    ans = 'X' if N > M else 'Y'
    for i in range(A * 3):
        if X[i%N] > Y[i%M]:
            ans = 'X'
            break
        elif X[i%N] < Y[i%M]:
            ans = 'Y'
            break
    out.append(ans)
print(*out, sep='\n')
0