結果
問題 |
No.9 モンスターのレベル上げ
|
ユーザー |
![]() |
提出日時 | 2017-05-01 14:15:13 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 990 bytes |
コンパイル時間 | 220 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 205,440 KB |
最終ジャッジ日時 | 2024-09-14 01:52:48 |
合計ジャッジ時間 | 32,375 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 TLE * 3 -- * 7 |
ソースコード
# coding: utf-8 import array, bisect, collections, copy, heapq, itertools, math, random, re, string, sys, time sys.setrecursionlimit(10 ** 7) INF = 10 ** 20 MOD = 10 ** 9 + 7 def II(): return int(input()) def ILI(): return list(map(int, input().split())) def IAI(LINE): return [ILI() for __ in range(LINE)] def IDI(): return {key: value for key, value in ILI()} def solve(N, A, B): my_mon = [] for a in A: heapq.heappush(my_mon, [a, 0]) ans = INF for i in range(N): my_mon_copy = copy.deepcopy(my_mon) ene_mon = B[i: N] + B[0: i] for ene in ene_mon: fig_mon = heapq.heappop(my_mon_copy) heapq.heappush(my_mon_copy, [fig_mon[0] + (ene // 2), fig_mon[1] + 1]) l_fight = [mon[1] for mon in my_mon_copy] max_num = max(l_fight) ans = min(ans, max_num) return ans def main(): N = II() A = ILI() B = ILI() print(solve(N, A, B)) if __name__ == "__main__": main()