結果
| 問題 | No.9 モンスターのレベル上げ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-04-12 21:34:45 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 2,516 ms / 5,000 ms |
| コード長 | 442 bytes |
| 記録 | |
| コンパイル時間 | 249 ms |
| コンパイル使用メモリ | 84,984 KB |
| 実行使用メモリ | 98,020 KB |
| 最終ジャッジ日時 | 2026-03-17 16:22:58 |
| 合計ジャッジ時間 | 21,106 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
from heapq import heappush, heappop
n = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 10**10
base = []
for ind,a in enumerate(A):
heappush(base, (a,0,ind))
for i in range(n):
count = [0]*n
h = base.copy()
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)