結果

問題 No.9 モンスターのレベル上げ
ユーザー chocoruskchocorusk
提出日時 2020-09-07 13:58:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 4,477 ms / 5,000 ms
コード長 353 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-05-06 23:43:01
合計ジャッジ時間 38,656 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,752 KB
testcase_01 AC 35 ms
10,752 KB
testcase_02 AC 3,826 ms
11,136 KB
testcase_03 AC 2,990 ms
11,136 KB
testcase_04 AC 1,600 ms
10,880 KB
testcase_05 AC 1,096 ms
11,008 KB
testcase_06 AC 409 ms
10,880 KB
testcase_07 AC 36 ms
10,752 KB
testcase_08 AC 541 ms
10,880 KB
testcase_09 AC 3,667 ms
11,136 KB
testcase_10 AC 29 ms
10,624 KB
testcase_11 AC 3,466 ms
11,136 KB
testcase_12 AC 4,477 ms
10,880 KB
testcase_13 AC 3,537 ms
11,136 KB
testcase_14 AC 3,776 ms
11,136 KB
testcase_15 AC 3,505 ms
11,136 KB
testcase_16 AC 92 ms
10,752 KB
testcase_17 AC 2,166 ms
11,008 KB
testcase_18 AC 1,838 ms
11,008 KB
testcase_19 AC 66 ms
10,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int, input().split()))
b=list(map(int, input().split()))
b=b+b
import heapq
ans=n
for i in range(n):
    que=[(x, 0) for x in a]
    heapq.heapify(que)
    for x in b[i:i+n]:
        p=que[0]
        heapq.heappushpop(que, (p[0]+x//2, p[1]+1))
    mx=0
    for p in que:
        mx=max(mx, p[1])
    ans=min(ans, mx)
print(ans)
0