結果

問題 No.9 モンスターのレベル上げ
ユーザー OKCH3COOHOKCH3COOH
提出日時 2019-10-23 22:17:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,212 ms / 5,000 ms
コード長 431 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 89,244 KB
最終ジャッジ日時 2023-09-21 11:13:53
合計ジャッジ時間 13,513 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,376 KB
testcase_01 AC 80 ms
71,076 KB
testcase_02 AC 1,212 ms
89,244 KB
testcase_03 AC 979 ms
86,584 KB
testcase_04 AC 595 ms
81,068 KB
testcase_05 AC 442 ms
80,236 KB
testcase_06 AC 272 ms
79,092 KB
testcase_07 AC 130 ms
78,212 KB
testcase_08 AC 295 ms
79,236 KB
testcase_09 AC 1,165 ms
88,324 KB
testcase_10 AC 79 ms
71,084 KB
testcase_11 AC 861 ms
84,932 KB
testcase_12 AC 898 ms
81,264 KB
testcase_13 AC 780 ms
83,848 KB
testcase_14 AC 1,147 ms
89,180 KB
testcase_15 AC 1,042 ms
88,136 KB
testcase_16 AC 156 ms
77,796 KB
testcase_17 AC 741 ms
82,696 KB
testcase_18 AC 630 ms
82,384 KB
testcase_19 AC 141 ms
77,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heapify, heappop, heappush

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

myMonster = [(a, 0) for a in A]
heapify(myMonster)
ans = float('inf')

for start in range(N):
    A = myMonster[:]
    for b in B[start:] + B[:start]:
        now, time = heappop(A)
        now += b // 2
        heappush(A, (now, time + 1))
    ans = min(ans, max([a for _, a in A]))

print(ans)
0