結果
| 問題 | No.9 モンスターのレベル上げ |
| コンテスト | |
| ユーザー |
Kude
|
| 提出日時 | 2020-09-03 08:01:36 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 503 bytes |
| 記録 | |
| コンパイル時間 | 160 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 118,272 KB |
| 最終ジャッジ日時 | 2026-05-16 18:35:45 |
| 合計ジャッジ時間 | 26,979 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 WA * 2 |
ソースコード
from heapq import heappush, heappop
def solve():
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
b = b + b
ans = n
for s in range(n):
q = []
cnt = [0] * n
for i, ai in enumerate(a):
heappush(q, (ai, -1, i))
for j in range(s, s + n):
ai, _, i = heappop(q)
cnt[i] += 1
heappush(q, (ai + b[j] // 2, j, i))
ans = min(ans, max(cnt))
print(ans)
solve()
Kude