結果
問題 | No.38 赤青白ブロック |
ユーザー | chocorusk |
提出日時 | 2020-09-09 12:46:00 |
言語 | Python3 (3.11.6 + numpy 1.26.0 + scipy 1.11.3) |
結果 |
AC
|
実行時間 | 1,100 ms / 5,000 ms |
コード長 | 688 bytes |
コンパイル時間 | 385 ms |
コンパイル使用メモリ | 10,980 KB |
実行使用メモリ | 8,304 KB |
最終ジャッジ日時 | 2023-08-21 09:01:39 |
合計ジャッジ時間 | 3,470 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 16 ms
8,188 KB |
testcase_01 | AC | 371 ms
8,180 KB |
testcase_02 | AC | 21 ms
8,188 KB |
testcase_03 | AC | 16 ms
8,228 KB |
testcase_04 | AC | 15 ms
8,156 KB |
testcase_05 | AC | 15 ms
8,124 KB |
testcase_06 | AC | 30 ms
8,276 KB |
testcase_07 | AC | 19 ms
8,136 KB |
testcase_08 | AC | 15 ms
8,288 KB |
testcase_09 | AC | 36 ms
8,188 KB |
testcase_10 | AC | 16 ms
8,276 KB |
testcase_11 | AC | 15 ms
8,132 KB |
testcase_12 | AC | 16 ms
8,216 KB |
testcase_13 | AC | 15 ms
8,292 KB |
testcase_14 | AC | 15 ms
8,304 KB |
testcase_15 | AC | 17 ms
8,216 KB |
testcase_16 | AC | 55 ms
8,216 KB |
testcase_17 | AC | 17 ms
8,208 KB |
testcase_18 | AC | 22 ms
8,256 KB |
testcase_19 | AC | 21 ms
8,292 KB |
testcase_20 | AC | 18 ms
8,292 KB |
testcase_21 | AC | 16 ms
8,128 KB |
testcase_22 | AC | 1,100 ms
8,256 KB |
testcase_23 | AC | 16 ms
8,272 KB |
testcase_24 | AC | 23 ms
8,160 KB |
testcase_25 | AC | 17 ms
8,220 KB |
testcase_26 | AC | 18 ms
8,252 KB |
ソースコード
import sys read=sys.stdin.buffer.read readline=sys.stdin.buffer.readline readlines=sys.stdin.buffer.readlines kr, kb=map(int, readline().split()) s=readline().rstrip().decode() idx=[i for i, c in enumerate(s) if c!='W'] import itertools for l in range(20): for myon in itertools.combinations(idx, l): t=[c for i, c in enumerate(s) if i not in myon] dame=False for j, c in enumerate(t): if c=='R' and j+kr<len(t) and t[j+kr]=='R': dame=True break elif c=='B' and j+kb<len(t) and t[j+kb]=='B': dame=True break if not dame: print(30-l) exit()