結果
| 問題 | No.3685 ワロングアンサーやんけ! |
| コンテスト | |
| ユーザー |
ゼット
|
| 提出日時 | 2026-09-05 13:56:58 |
| 言語 | PyPy3 (7.3.23) |
| 結果 |
AC
|
| 実行時間 | 548 ms / 2,000 ms |
| + 924µs | |
| コード長 | 724 bytes |
| 記録 | |
| コンパイル時間 | 238 ms |
| コンパイル使用メモリ | 95,812 KB |
| 実行使用メモリ | 118,520 KB |
| 最終ジャッジ日時 | 2026-09-05 13:58:30 |
| 合計ジャッジ時間 | 7,728 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 32 |
ソースコード
Q=int(input())
for _ in range(Q):
S=input()
t=input()
K=int(input())
N=len(S)
h=[0]*N
for i in range(N):
h[i]=S[i]
if t[0]=='W':
for i in range(K):
h[i]='A'
p=[]
count=0
for i in range(K,N):
if S[i]=='W':
count+=1
if S[i]=='?':
p.append(i)
if count==0 and len(p)==1:
pos=p[0]
h[pos]='W'
else:
count=0
for i in range(K,N):
if S[i]=='W':
count+=1
p=[]
e=0
for i in range(K):
if S[i]=='W':
e+=1
if S[i]=='?':
p.append(i)
if e==0 and count>0 and len(p)==1:
pos=p[0]
h[pos]='W'
if e+len(p)==0:
for i in range(K,N):
h[i]='A'
print(*h,sep='')
ゼット