結果
| 問題 | No.9 モンスターのレベル上げ |
| コンテスト | |
| ユーザー |
yaoshimax
|
| 提出日時 | 2015-02-09 17:22:38 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
AC
|
| 実行時間 | 845 ms / 5,000 ms |
| + 642µs | |
| コード長 | 388 bytes |
| 記録 | |
| コンパイル時間 | 65 ms |
| コンパイル使用メモリ | 80,896 KB |
| 実行使用メモリ | 96,236 KB |
| 最終ジャッジ日時 | 2026-07-17 09:13:09 |
| 合計ジャッジ時間 | 10,004 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
from heapq import heappush,heappop
N=int(raw_input())
A=map(int, raw_input().split())
B=map(int, raw_input().split())
ans = N
for i in range (N):
pq=[]
curAns = 0
for a in A:
heappush(pq,(a,0))
for j in range(N):
ind=(i+j)%N
level,num=heappop(pq)
heappush(pq,(level+B[ind]/2,num+1))
curAns = max(curAns,num+1)
ans = min(ans,curAns)
print ans
yaoshimax