結果

問題 No.9 モンスターのレベル上げ
ユーザー roarisroaris
提出日時 2019-10-26 12:11:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,518 ms / 5,000 ms
コード長 437 bytes
コンパイル時間 1,145 ms
コンパイル使用メモリ 87,128 KB
実行使用メモリ 97,120 KB
最終ジャッジ日時 2023-10-12 05:37:27
合計ジャッジ時間 16,996 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
71,292 KB
testcase_01 AC 83 ms
71,280 KB
testcase_02 AC 1,518 ms
97,120 KB
testcase_03 AC 1,285 ms
91,552 KB
testcase_04 AC 738 ms
83,696 KB
testcase_05 AC 536 ms
81,780 KB
testcase_06 AC 320 ms
79,356 KB
testcase_07 AC 143 ms
78,268 KB
testcase_08 AC 363 ms
79,560 KB
testcase_09 AC 1,454 ms
96,188 KB
testcase_10 AC 81 ms
71,364 KB
testcase_11 AC 1,228 ms
90,084 KB
testcase_12 AC 1,336 ms
90,804 KB
testcase_13 AC 922 ms
86,300 KB
testcase_14 AC 1,485 ms
95,880 KB
testcase_15 AC 1,407 ms
93,952 KB
testcase_16 AC 177 ms
78,208 KB
testcase_17 AC 1,008 ms
88,304 KB
testcase_18 AC 780 ms
84,688 KB
testcase_19 AC 167 ms
78,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heappush, heappop

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = 10**18

for i in range(N):
    pq = []
    
    for j in range(N):
        heappush(pq, (A[j], 0))
    
    for j in range(N):
        level, cnt = heappop(pq)
        level += B[(i+j)%N]//2
        cnt += 1
        heappush(pq, (level, cnt))
    
    ans = min(ans, max(cnt for _, cnt in pq))

print(ans)
0