結果

問題 No.9 モンスターのレベル上げ
コンテスト
ユーザー aaaaaaaaaa2230
提出日時 2021-04-12 21:32:43
言語 PyPy3
(7.3.23)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 3,376 ms / 5,000 ms
+ 410µs
コード長 428 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 481 ms
コンパイル使用メモリ 95,976 KB
実行使用メモリ 122,800 KB
最終ジャッジ日時 2026-08-01 03:45:43
合計ジャッジ時間 26,109 ms
ジャッジサーバーID
(参考情報)
judge2_0 / 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