結果

問題 No.3685 ワロングアンサーやんけ!
コンテスト
ユーザー 👑 loop0919
提出日時 2026-09-04 21:51:56
言語 PyPy3
(7.3.23)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
(最新)
RE  
(最初)
実行時間 499 ms / 2,000 ms
+ 393µs
コード長 559 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 251 ms
コンパイル使用メモリ 95,952 KB
実行使用メモリ 109,476 KB
最終ジャッジ日時 2026-09-05 12:48:42
合計ジャッジ時間 6,782 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def solve():
    S = [*input()]
    T = input()
    M = int(input())
    
    N = len(S)

    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="")


if __name__ == "__main__":
    T = int(input())

    for _ in range(T):
        solve()
0