結果

問題 No.9 モンスターのレベル上げ
ユーザー roarisroaris
提出日時 2019-10-26 12:11:20
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 1,548 ms / 5,000 ms
コード長 437 bytes
コンパイル時間 326 ms
使用メモリ 101,000 KB
最終ジャッジ日時 2023-02-26 13:48:17
合計ジャッジ時間 18,372 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 89 ms
75,804 KB
testcase_01 AC 90 ms
75,744 KB
testcase_02 AC 1,548 ms
100,444 KB
testcase_03 AC 1,336 ms
95,804 KB
testcase_04 AC 770 ms
87,728 KB
testcase_05 AC 558 ms
85,496 KB
testcase_06 AC 348 ms
83,488 KB
testcase_07 AC 157 ms
82,380 KB
testcase_08 AC 384 ms
84,132 KB
testcase_09 AC 1,508 ms
100,280 KB
testcase_10 AC 88 ms
75,792 KB
testcase_11 AC 1,259 ms
94,976 KB
testcase_12 AC 1,483 ms
94,780 KB
testcase_13 AC 946 ms
89,696 KB
testcase_14 AC 1,512 ms
101,000 KB
testcase_15 AC 1,448 ms
98,920 KB
testcase_16 AC 192 ms
82,612 KB
testcase_17 AC 1,010 ms
91,552 KB
testcase_18 AC 810 ms
88,980 KB
testcase_19 AC 180 ms
82,456 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