結果
| 問題 | No.3685 ワロングアンサーやんけ! |
| コンテスト | |
| ユーザー |
まぬお
|
| 提出日時 | 2026-09-05 14:22:21 |
| 言語 | PyPy3 (7.3.23) |
| 結果 |
AC
|
| 実行時間 | 219 ms / 2,000 ms |
| + 707µs | |
| コード長 | 1,033 bytes |
| 記録 | |
| コンパイル時間 | 465 ms |
| コンパイル使用メモリ | 96,064 KB |
| 実行使用メモリ | 98,148 KB |
| 最終ジャッジ日時 | 2026-09-05 14:22:53 |
| 合計ジャッジ時間 | 7,201 ms |
|
ジャッジサーバーID (参考情報) |
judge6_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 32 |
ソースコード
from collections import deque, defaultdict, Counter
from bisect import bisect_left, bisect_right, insort
from itertools import permutations, combinations, groupby
from heapq import heappop, heappush
import math, sys
input = lambda: sys.stdin.readline().rstrip("\r\n")
def printl(li, sep=" "): print(sep.join(map(str, li)))
def yn(flag): print(Yes if flag else No)
_int = lambda x: int(x)-1
MOD = 998244353 #10**9+7
INF = 1<<60
Yes, No = "Yes", "No"
for _ in range(int(input())):
R = list(input())
S = input()
K = int(input())
N = len(R)
if S == "NotWarong":
if R[:K].count("A") == K:
for i in range(N):
if R[i] == "?": R[i] = "A"
if R[K:].count("W") > 0:
if R[:K].count("A") == K-1 and R[:K].count("?") == 1:
R[R.index("?")] = "W"
else:
for i in range(K):
if R[i] == "?":
R[i] = "A"
if R[K:].count("?") == 1 and R[K:].count("W") == 0:
R[R[K:].index("?")+K] = "W"
printl(R, "")
まぬお