結果

問題 No.38 赤青白ブロック
ユーザー letrangerjpletrangerjp
提出日時 2017-06-14 12:14:14
言語 Ruby
(3.3.0)
結果
AC  
実行時間 254 ms / 5,000 ms
コード長 197 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 11,312 KB
実行使用メモリ 16,508 KB
最終ジャッジ日時 2023-08-25 01:23:06
合計ジャッジ時間 4,047 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
15,324 KB
testcase_01 AC 180 ms
16,328 KB
testcase_02 AC 96 ms
15,620 KB
testcase_03 AC 88 ms
15,276 KB
testcase_04 AC 88 ms
15,296 KB
testcase_05 AC 79 ms
15,312 KB
testcase_06 AC 143 ms
16,272 KB
testcase_07 AC 103 ms
15,740 KB
testcase_08 AC 80 ms
15,360 KB
testcase_09 AC 147 ms
16,136 KB
testcase_10 AC 79 ms
15,180 KB
testcase_11 AC 80 ms
15,160 KB
testcase_12 AC 80 ms
15,252 KB
testcase_13 AC 79 ms
15,252 KB
testcase_14 AC 79 ms
15,088 KB
testcase_15 AC 93 ms
15,524 KB
testcase_16 AC 116 ms
15,720 KB
testcase_17 AC 89 ms
15,408 KB
testcase_18 AC 109 ms
15,588 KB
testcase_19 AC 96 ms
15,364 KB
testcase_20 AC 91 ms
15,308 KB
testcase_21 AC 86 ms
15,408 KB
testcase_22 AC 254 ms
16,508 KB
testcase_23 AC 82 ms
15,084 KB
testcase_24 AC 114 ms
16,268 KB
testcase_25 AC 87 ms
15,300 KB
testcase_26 AC 91 ms
15,432 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

eval"R,B=%d,%d
D={}
f=->s{n=s.size
D[s]||=$.<n&&(0...n).any?{|i|s[i]<?R?i-B>=0&&s[i-B]<?R:s[i]<?W&&i-R>=0&&s[i-R]==?R}?n.times{|i|s[i]>?R||f[s[0,i]+s[i+1,n]]}:n>$.&&$.=n}
f['%s']
p$."%gets(p).split
0