結果

問題 No.38 赤青白ブロック
ユーザー letrangerjpletrangerjp
提出日時 2017-06-14 12:25:53
言語 Ruby
(3.3.0)
結果
AC  
実行時間 283 ms / 5,000 ms
コード長 194 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 11,388 KB
実行使用メモリ 16,528 KB
最終ジャッジ日時 2023-08-25 01:23:15
合計ジャッジ時間 4,155 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
外部呼び出し有り
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,156 KB
testcase_01 AC 187 ms
16,204 KB
testcase_02 AC 98 ms
15,448 KB
testcase_03 AC 85 ms
15,308 KB
testcase_04 AC 79 ms
15,052 KB
testcase_05 AC 80 ms
15,304 KB
testcase_06 AC 148 ms
16,136 KB
testcase_07 AC 103 ms
15,852 KB
testcase_08 AC 81 ms
15,128 KB
testcase_09 AC 157 ms
16,288 KB
testcase_10 AC 78 ms
15,152 KB
testcase_11 AC 76 ms
15,364 KB
testcase_12 AC 77 ms
15,340 KB
testcase_13 AC 77 ms
15,152 KB
testcase_14 AC 79 ms
15,032 KB
testcase_15 AC 91 ms
15,244 KB
testcase_16 AC 118 ms
15,848 KB
testcase_17 AC 87 ms
15,388 KB
testcase_18 AC 110 ms
15,588 KB
testcase_19 AC 97 ms
15,212 KB
testcase_20 AC 95 ms
15,428 KB
testcase_21 AC 88 ms
15,432 KB
testcase_22 AC 283 ms
16,528 KB
testcase_23 AC 79 ms
15,144 KB
testcase_24 AC 112 ms
16,164 KB
testcase_25 AC 84 ms
15,224 KB
testcase_26 AC 85 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|[[?R,i-R],[?B,i-B]].any?{|c,j|s[i]==c&&j>=0&&s[j]==c}}?n.times{|i|s[i]>?R||f[s[0,i]+s[i+1,n]]}:n>$.&&$.=n}
f['%s']
p$."%`dd`.split
0