結果

問題 No.9 モンスターのレベル上げ
コンテスト
ユーザー aaaaaaaaaa2230
提出日時 2021-04-12 21:32:43
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 3,611 ms / 5,000 ms
コード長 428 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 238 ms
コンパイル使用メモリ 85,040 KB
実行使用メモリ 120,436 KB
最終ジャッジ日時 2026-03-17 16:16:18
合計ジャッジ時間 26,136 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from heapq import heappush, heappop

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

ans = 10**10
for i in range(n):
    h = []
    count = [0]*n
    for ind,a in enumerate(A):
        heappush(h, (a,0,ind))
    for j in range(n):
        a,num,ind = heappop(h)
        count[ind] += 1
        a += B[(i+j)%n]//2
        heappush(h, (a,num+1,ind))
    ans = min(ans,max(count))
print(ans)
0