結果

問題 No.2030 Googol Strings
ユーザー MasKoaTSMasKoaTS
提出日時 2022-08-05 23:15:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 252 ms / 2,000 ms
コード長 1,146 bytes
コンパイル時間 423 ms
コンパイル使用メモリ 86,644 KB
実行使用メモリ 92,288 KB
最終ジャッジ日時 2023-10-14 01:04:49
合計ジャッジ時間 5,646 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 252 ms
84,532 KB
testcase_01 AC 209 ms
82,792 KB
testcase_02 AC 212 ms
86,508 KB
testcase_03 AC 199 ms
81,028 KB
testcase_04 AC 251 ms
84,524 KB
testcase_05 AC 211 ms
82,872 KB
testcase_06 AC 210 ms
91,728 KB
testcase_07 AC 216 ms
92,244 KB
testcase_08 AC 218 ms
92,020 KB
testcase_09 AC 211 ms
82,792 KB
testcase_10 AC 201 ms
82,840 KB
testcase_11 AC 210 ms
82,724 KB
testcase_12 AC 246 ms
84,108 KB
testcase_13 AC 237 ms
84,048 KB
testcase_14 AC 209 ms
82,800 KB
testcase_15 AC 222 ms
88,440 KB
testcase_16 AC 222 ms
92,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools as iter
import collections as coll
import heapq as hq
import bisect as bis
from decimal import Decimal as dec
from functools import cmp_to_key
import math
import sys
#import pypyjit
#pypyjit.set_param('max_unroll_recursion=-1')
sys.setrecursionlimit(10 ** 6)
inp = sys.stdin.readline
input = lambda : inp().rstrip()
getN = lambda : int(inp())
getNs = lambda : map(int, inp().split())
getList = lambda :list(map(int, inp().split()))
getStrs = lambda n : [input() for _ in [0] * n]
def yexit(): print("Yes"); exit(0)
def nexit(): print("No"); exit(0)
pi = 3.141592653589793
mod = 1000000007
MOD = 998244353
INF = 4611686018427387903
dx = [1, 0, -1, 0];	dy = [0, 1, 0, -1]


"""
Main Code
"""

ans = []
for _ in [0] * getN():
	s = ''.join([input()]*2)
	t = ''.join([input()]*2)
	ma = max(len(s), len(t))
	mi = min(len(s), len(t))
	lis1 = [s] * ((ma - 1) // len(s) + 1);	ss = ''.join(lis1)
	lis2 = [t] * ((ma - 1) // len(t) + 1);	tt = ''.join(lis2)
	if(ss[:ma] == tt[:ma]):
		if(len(s) == ma):
			ans.append('X')
		else:
			ans.append('Y')
		continue
	if(ss > tt):
		ans.append('X')
	else:
		ans.append('Y')

for c in ans:
	print(c)
0