結果

問題 No.2030 Googol Strings
ユーザー SidewaysOwlSidewaysOwl
提出日時 2022-08-05 22:12:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 409 bytes
コンパイル時間 2,137 ms
コンパイル使用メモリ 86,192 KB
実行使用メモリ 223,580 KB
最終ジャッジ日時 2023-10-13 23:19:10
合計ジャッジ時間 5,919 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 171 ms
77,720 KB
testcase_01 AC 119 ms
80,416 KB
testcase_02 AC 134 ms
114,700 KB
testcase_03 AC 74 ms
71,116 KB
testcase_04 WA -
testcase_05 AC 123 ms
79,716 KB
testcase_06 AC 216 ms
186,344 KB
testcase_07 AC 266 ms
223,376 KB
testcase_08 AC 265 ms
223,580 KB
testcase_09 AC 115 ms
81,676 KB
testcase_10 AC 115 ms
82,536 KB
testcase_11 AC 117 ms
82,096 KB
testcase_12 AC 165 ms
77,408 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 291 ms
176,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    x = list(input())
    y = list(input())
    xx = x + x
    yy = y + y
    n = min(len(x),len(y))*2
    cnt = 0
    for i in range(n):
        cnt += xx[i] == yy[i]
    if cnt != n:
        if xx > yy:
            print("X")
        elif xx < yy:
            print("Y")
    else:
        if len(x) > len(y):
            print("X")
        else:
            print("Y")
        
0