結果
| 問題 | No.9 モンスターのレベル上げ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-01-16 14:08:17 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 2,950 ms / 5,000 ms |
| コード長 | 420 bytes |
| 記録 | |
| コンパイル時間 | 184 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 123,236 KB |
| 最終ジャッジ日時 | 2026-06-04 09:48:09 |
| 合計ジャッジ時間 | 26,559 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
from heapq import heapify,heappop,heappush
inf=float("inf")
ans=inf
for i in range(n):
Q=[(A[j],0,j) for j in range(n)]
heapify(Q)
cnt=[0 for _ in range(n)]
for j in range(n):
a,c,ind=heappop(Q)
lv=B[(i+j)%n]//2
cnt[ind]+=1
heappush(Q,(a+lv,c+1,ind))
ans=min(ans,max(cnt))
print(ans)