結果

問題 No.3685 ワロングアンサーやんけ!
コンテスト
ユーザー 黒目
提出日時 2026-09-07 18:33:22
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 1,275 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 94 ms
コンパイル使用メモリ 80,896 KB
実行使用メモリ 91,264 KB
最終ジャッジ日時 2026-09-07 18:33:44
合計ジャッジ時間 5,713 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 13 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

T = int(input())

for t in range(T):
    R = input()
    S = input()
    K = int(input())
    N = len(R)
    res = []
    for r in R:
        res.append(r)

    if S == "Warong":
        for k in range(K):
            if res[k] == "?":
                res[k] = "A"
        is_w_contain = False
        is_only_q = False
        if res[K:N].count("?") == 1:
            is_only_q = True
        for n in range(K, N):
            if res[n] == "W":
                is_w_contain = True
        
        if is_w_contain is False and is_only_q:
            for n in range(K, N):
                if res[n] == "?":
                    res[n] = "W"

        print("".join(res))       
    else:
        is_all_a = True
        is_w_contain = False
        for k in range(K):
            if res[k] == "W":
                is_w_contain = True
            if res[k] != "A":
                is_all_a = False
        is_only_q = False
        if res[:K].count("?") == 1:
            is_only_q = True
        
        if is_w_contain is False and is_only_q:
            for k in range(K):
                if res[k] == "?":
                    res[k] = "W"
        if is_all_a:
            for n in range(K, N):
                res[n] = "A"
        # print("aaa")
        print("".join(res))
0