結果
問題 | No.9 モンスターのレベル上げ |
ユーザー |
|
提出日時 | 2022-02-05 17:06:27 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 490 bytes |
コンパイル時間 | 300 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 89,556 KB |
最終ジャッジ日時 | 2024-06-11 13:36:49 |
合計ジャッジ時間 | 19,654 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 WA * 14 |
ソースコード
from heapq import heapify, heappop, heappush n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) ans = [] for start in range(n): q = [] heapify(q) for i in range(n): heappush(q, (a[i], 0)) for i in range(n): p, num = heappop(q) p += b[(start + i) % n] // 2 heappush(q, (p, num + 1)) ma = 0 for i in range(n): ma = max(ma, heappop(q)[1]) ans.append(ma) print(max(ans))