結果

問題 No.9 モンスターのレベル上げ
ユーザー gigurururugigurururu
提出日時 2014-11-05 21:26:35
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 270 bytes
コンパイル時間 124 ms
コンパイル使用メモリ 11,300 KB
実行使用メモリ 20,216 KB
最終ジャッジ日時 2023-08-29 00:41:36
合計ジャッジ時間 6,925 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
15,084 KB
testcase_01 AC 83 ms
15,132 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
a=gets.split.map(&:to_i).sort+[1e9]
b=gets.split.map(&:to_i)
p (1..n).map{|i|
  pq=a.map{|j|[j,0]}
  b.rotate(i).each{|e|
    l,c=pq.shift
    up=[l+e/2,c+1]
    pq[(0..n-1).bsearch{|x|(pq[x]<=>up)>=0},0]=[up]
  }
  pq[0..-2].map{|x,y|y}.max
}.min
0