結果

問題 No.3685 ワロングアンサーやんけ!
コンテスト
ユーザー Kude
提出日時 2026-09-05 13:40:00
言語 PyPy3
(7.3.23)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 480 ms / 2,000 ms
+ 277µs
コード長 759 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 227 ms
コンパイル使用メモリ 95,820 KB
実行使用メモリ 86,520 KB
最終ジャッジ日時 2026-09-05 13:41:19
合計ジャッジ時間 6,204 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

for _ in range(int(input())):
    r = list(input())
    s = input()
    k = int(input())
    n = len(r)
    if s == 'Warong':
        for i in range(k):
            r[i] = 'A'
        tmp = r[k:]
        if 'W' not in tmp and tmp.count('?') == 1:
            tmp[tmp.index('?')] = 'W'
        r[k:] = tmp
        print(''.join(r))
    else:
        if 'W' in r[:k]:
            print(''.join(r))
            continue
        if 'W' in r:
            tmp = r[:k]
            if tmp.count('?') == 1:
                tmp[tmp.index('?')] = 'W'
            r[:k] = tmp
            print(''.join(r))
            continue
        tmp1 = r[:k]
        c1 = tmp1.count('?')
        if c1 == 0:
            print('A' * n)
            continue
        print(''.join(r))
0