結果

問題 No.9 モンスターのレベル上げ
ユーザー letrangerjpletrangerjp
提出日時 2017-05-14 15:56:05
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 442 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 11,376 KB
実行使用メモリ 19,960 KB
最終ジャッジ日時 2023-10-14 10:57:15
合計ジャッジ時間 6,831 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,296 KB
testcase_01 AC 84 ms
15,084 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 #

def f(a, b)
  _party = a.map{|v| v * MOD}.sort
  troop = b.map{|v|v/2}
  troop.size.times.map{
    party = _party.dup
    troop.each{|elv|
      lv_cnt = party.shift + elv * MOD + 1
      nth = party.index{|v| v >= lv_cnt} || party.size
      party.insert(nth, lv_cnt)
    }
    troop.rotate!
    party.map{|v| v % MOD}.max
  }.min
end

N = gets.to_i
A = gets.split.take(N).map(&:to_i)
B = gets.split.take(N).map(&:to_i)
MOD = 2000
p f(A, B)
0