結果

問題 No.107 モンスター
ユーザー gigurururugigurururu
提出日時 2014-12-20 00:01:06
言語 Ruby
(3.3.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 167 bytes
コンパイル時間 388 ms
コンパイル使用メモリ 11,416 KB
実行使用メモリ 36,912 KB
最終ジャッジ日時 2023-09-02 19:33:42
合計ジャッジ時間 9,699 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,240 KB
testcase_01 AC 79 ms
15,304 KB
testcase_02 AC 79 ms
15,172 KB
testcase_03 AC 81 ms
15,232 KB
testcase_04 AC 80 ms
15,156 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 81 ms
15,120 KB
testcase_09 AC 81 ms
15,224 KB
testcase_10 AC 82 ms
15,048 KB
testcase_11 AC 83 ms
15,052 KB
testcase_12 AC 83 ms
15,044 KB
testcase_13 AC 268 ms
19,728 KB
testcase_14 AC 495 ms
25,552 KB
testcase_15 AC 497 ms
25,568 KB
testcase_16 AC 80 ms
15,228 KB
testcase_17 AC 162 ms
17,804 KB
testcase_18 AC 981 ms
36,912 KB
testcase_19 AC 976 ms
36,792 KB
testcase_20 AC 256 ms
19,624 KB
testcase_21 AC 256 ms
19,760 KB
testcase_22 AC 473 ms
25,532 KB
testcase_23 AC 983 ms
36,732 KB
testcase_24 AC 973 ms
36,732 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N=gets.to_i
D=gets.split.map &:to_i
H={[]=>100}
def dfs d,h
H[d]||=d.map{|i|(t=dfs d-[i],D[i]<0?h-1:h)<1?0:[t+D[i],h*100].min}.max
end
p dfs [*0...N],D.count{|i|i<0}+1
0