結果
| 問題 | No.38 赤青白ブロック |
| コンテスト | |
| ユーザー |
tktk_snsn
|
| 提出日時 | 2021-01-24 14:23:40 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 799 ms / 5,000 ms |
| + 883µs | |
| コード長 | 581 bytes |
| 記録 | |
| コンパイル時間 | 67 ms |
| コンパイル使用メモリ | 82,268 KB |
| 実行使用メモリ | 83,620 KB |
| 最終ジャッジ日時 | 2026-10-10 08:12:41 |
| 合計ジャッジ時間 | 22,303 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 |
ソースコード
r, b = map(int, input().split())
S = input()
ans = 10
for bit in range(1 << 20):
i = 0
use = []
for s in S:
if s == "W":
use.append(s)
continue
if (bit >> i) & 1:
use.append(s)
i += 1
ok = True
for i, s in enumerate(use):
if s == "R" and i + r < len(use) and use[i + r] == "R":
ok = False
break
elif s == "B" and i + b < len(use) and use[i + b] == "B":
ok = False
break
if ok and len(use) > ans:
ans = len(use)
print(ans)
tktk_snsn