結果

問題 No.9 モンスターのレベル上げ
ユーザー gigurururugigurururu
提出日時 2014-12-30 15:30:01
言語 Ruby
(3.3.0)
結果
AC  
実行時間 4,123 ms / 5,000 ms
コード長 265 bytes
コンパイル時間 211 ms
コンパイル使用メモリ 11,296 KB
実行使用メモリ 15,588 KB
最終ジャッジ日時 2023-09-06 03:18:42
合計ジャッジ時間 40,806 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
15,148 KB
testcase_01 AC 83 ms
15,044 KB
testcase_02 AC 4,110 ms
15,488 KB
testcase_03 AC 3,172 ms
15,528 KB
testcase_04 AC 1,611 ms
15,580 KB
testcase_05 AC 1,073 ms
15,564 KB
testcase_06 AC 409 ms
15,472 KB
testcase_07 AC 87 ms
15,172 KB
testcase_08 AC 524 ms
15,308 KB
testcase_09 AC 3,917 ms
15,468 KB
testcase_10 AC 83 ms
15,136 KB
testcase_11 AC 3,874 ms
15,492 KB
testcase_12 AC 4,123 ms
15,456 KB
testcase_13 AC 4,028 ms
15,428 KB
testcase_14 AC 3,909 ms
15,448 KB
testcase_15 AC 3,573 ms
15,424 KB
testcase_16 AC 133 ms
15,212 KB
testcase_17 AC 2,307 ms
15,588 KB
testcase_18 AC 1,848 ms
15,340 KB
testcase_19 AC 111 ms
15,228 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
mod=2000
a=gets.split.map{|i|i.to_i*mod}.sort+[1e9]
b=gets.split.map{|i|i.to_i/2}
p (1..n).map{|i|
  pq=a.dup
  b.rotate(i).each{|e|
    l=pq.shift
    up=l+e*mod+1
    pq.insert((0..n-1).bsearch{|x|pq[x]>=up},up)
  }
  pq[0..-2].map{|x|x%mod}.max
}.min
0