結果
| 問題 |
No.2030 Googol Strings
|
| コンテスト | |
| ユーザー |
wattaihei
|
| 提出日時 | 2022-08-05 23:04:32 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 207 ms / 2,000 ms |
| コード長 | 565 bytes |
| コンパイル時間 | 519 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 165,780 KB |
| 最終ジャッジ日時 | 2024-09-15 20:35:23 |
| 合計ジャッジ時間 | 3,751 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 16 |
ソースコード
import sys
input = sys.stdin.readline
def subsolve(X, Y):
lx = len(X)
ly = len(Y)
res = ["X", "Y"]
if lx > ly:
res = ["Y", "X"]
X, Y = Y, X
lx, ly = ly, lx
for i in range(2*ly):
x = X[i%lx]
y = Y[i%ly]
if x > y:
return res[0]
elif y > x:
return res[1]
if lx > ly:
return res[0]
if ly > lx:
return res[1]
Q = int(input())
for _ in range(Q):
X = list(input().rstrip())
Y = list(input().rstrip())
print(subsolve(X, Y))
wattaihei