結果

問題 No.3685 ワロングアンサーやんけ!
コンテスト
ユーザー 👑 loop0919
提出日時 2026-07-14 23:38:05
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 408 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 232 ms
コンパイル使用メモリ 96,324 KB
実行使用メモリ 91,208 KB
最終ジャッジ日時 2026-09-05 12:39:53
合計ジャッジ時間 7,816 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 1
other RE * 32
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N, M = [int(s) for s in input().split()]
S = [*input()]
T = input()

if T == "Warong":
    S[:M] = ["A"] * M
    if "W" not in S[M:] and S[M:].count("?") == 1:
        S[S.index("?")] = "W"

else:
    if "W" in S[M:] and all(s in ("A", "?") for s in S[:M]) and S[:M].count("?") == 1:
        S[S[:M].index("?")] = "W"
    elif all(s == "A" for s in S[:M]):
        S[M:] = ["A"] * (N - M)

print(*S, sep="")
0