結果
| 問題 |
No.38 赤青白ブロック
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2022-04-12 03:23:12 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 529 bytes |
| コンパイル時間 | 324 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 24,648 KB |
| 最終ジャッジ日時 | 2024-12-16 04:26:46 |
| 合計ジャッジ時間 | 169,819 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 27 |
ソースコード
r,b=map(int,input().split())
S=input()
def cond(A):
for i in range(len(A)):
if i+r<len(A) and A[i]==A[i+r]=="R":
return False
if i+b<len(A) and A[i]==A[i+b]=="B":
return False
return True
ANS=0
for i in range(1<<20):
A=[]
count=0
for j in range(len(S)):
if S[j]=="W":
A.append("W")
else:
if (1<<count) & i != 0 :
A.append(S[j])
count+=1
if cond(A)==True:
ANS=max(ANS,len(A))
print(ANS)
titia