結果

問題 No.107 モンスター
ユーザー gigurururugigurururu
提出日時 2014-12-19 01:45:33
言語 Ruby
(3.3.0)
結果
AC  
実行時間 493 ms / 5,000 ms
コード長 278 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 11,196 KB
実行使用メモリ 19,852 KB
最終ジャッジ日時 2023-08-27 05:25:11
合計ジャッジ時間 6,075 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,172 KB
testcase_01 AC 81 ms
15,088 KB
testcase_02 AC 80 ms
15,296 KB
testcase_03 AC 82 ms
15,124 KB
testcase_04 AC 80 ms
15,012 KB
testcase_05 AC 82 ms
15,116 KB
testcase_06 AC 81 ms
15,340 KB
testcase_07 AC 81 ms
15,124 KB
testcase_08 AC 82 ms
15,116 KB
testcase_09 AC 82 ms
15,120 KB
testcase_10 AC 82 ms
15,284 KB
testcase_11 AC 84 ms
15,080 KB
testcase_12 AC 82 ms
15,256 KB
testcase_13 AC 264 ms
18,116 KB
testcase_14 AC 480 ms
19,220 KB
testcase_15 AC 483 ms
19,420 KB
testcase_16 AC 81 ms
14,992 KB
testcase_17 AC 130 ms
17,396 KB
testcase_18 AC 115 ms
17,236 KB
testcase_19 AC 116 ms
17,448 KB
testcase_20 AC 326 ms
18,444 KB
testcase_21 AC 242 ms
18,176 KB
testcase_22 AC 399 ms
18,920 KB
testcase_23 AC 493 ms
19,852 KB
testcase_24 AC 313 ms
18,372 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N=gets.to_i
D=gets.split.map &:to_i
h={[]=>100}
N.times{
  t={}
  h.each{|k,v|
    ([*0...N]-k).each{|i|
      done=(k+[i]).sort
      hp=[[v+D[i],0].max,100+100*done.count{|j|D[j]<0}].min
      next if hp<=0
      t[done]=[t[done]||0,hp].max
    }
  }
  h=t
}
p h.values.max||0
0