結果

問題 No.9 モンスターのレベル上げ
ユーザー sotanishysotanishy
提出日時 2021-03-16 20:10:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,381 ms / 5,000 ms
コード長 479 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 82,420 KB
実行使用メモリ 94,444 KB
最終ジャッジ日時 2024-04-25 21:44:27
合計ジャッジ時間 14,719 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
54,464 KB
testcase_01 AC 39 ms
53,604 KB
testcase_02 AC 1,381 ms
94,208 KB
testcase_03 AC 1,167 ms
90,204 KB
testcase_04 AC 657 ms
81,840 KB
testcase_05 AC 470 ms
80,008 KB
testcase_06 AC 268 ms
77,888 KB
testcase_07 AC 99 ms
76,960 KB
testcase_08 AC 310 ms
78,176 KB
testcase_09 AC 1,354 ms
94,168 KB
testcase_10 AC 37 ms
52,584 KB
testcase_11 AC 1,134 ms
88,824 KB
testcase_12 AC 1,210 ms
89,356 KB
testcase_13 AC 850 ms
84,452 KB
testcase_14 AC 1,372 ms
94,444 KB
testcase_15 AC 1,303 ms
92,236 KB
testcase_16 AC 130 ms
76,572 KB
testcase_17 AC 897 ms
86,204 KB
testcase_18 AC 712 ms
82,792 KB
testcase_19 AC 122 ms
76,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heappush, heappop
import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = float('inf')
for i in range(N):
    heap = []
    for j in range(N):
        heappush(heap, (A[j], 0))
    for j in range(N):
        level, cnt = heappop(heap)
        level += B[(i+j)%N] // 2
        cnt += 1
        heappush(heap, (level, cnt))
    ans = min(ans, max(cnt for val, cnt in heap))
print(ans)
0