結果
| 問題 | No.3685 ワロングアンサーやんけ! |
| コンテスト | |
| ユーザー |
Kude
|
| 提出日時 | 2026-09-05 13:40:00 |
| 言語 | PyPy3 (7.3.23) |
| 結果 |
AC
|
| 実行時間 | 480 ms / 2,000 ms |
| + 277µs | |
| コード長 | 759 bytes |
| 記録 | |
| コンパイル時間 | 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 |
ソースコード
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))
Kude