結果
| 問題 | No.9 モンスターのレベル上げ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-01-16 14:08:17 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 2,634 ms / 5,000 ms |
| + 425µs | |
| コード長 | 420 bytes |
| 記録 | |
| コンパイル時間 | 64 ms |
| コンパイル使用メモリ | 82,888 KB |
| 実行使用メモリ | 124,140 KB |
| 最終ジャッジ日時 | 2026-10-09 18:32:05 |
| 合計ジャッジ時間 | 24,859 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge5_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)