結果
問題 |
No.38 赤青白ブロック
|
ユーザー |
![]() |
提出日時 | 2022-11-04 22:50:27 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 757 ms / 5,000 ms |
コード長 | 386 bytes |
コンパイル時間 | 261 ms |
コンパイル使用メモリ | 82,316 KB |
実行使用メモリ | 76,704 KB |
最終ジャッジ日時 | 2024-07-18 20:46:44 |
合計ジャッジ時間 | 17,224 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
ソースコード
import sys input=lambda:sys.stdin.readline().rstrip() K=list(map(int,input().split())) S=[['R','B','W'].index(i) for i in input()] ans=0 for i in range(2**20): temp=i cur=[] for j in S: if j==2 or temp%2: cur.append(j) if j<2: temp//=2 flg=1 for j in range(2): for k in range(len(cur)-K[j]): if cur[k]==cur[k+K[j]]==j: flg=0 ans=max(ans,len(cur)*flg) print(ans)