結果
問題 | No.9 モンスターのレベル上げ |
ユーザー |
|
提出日時 | 2022-04-16 08:21:31 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 470 bytes |
コンパイル時間 | 108 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-12-25 14:43:25 |
合計ジャッジ時間 | 43,638 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 TLE * 1 |
ソースコード
import heapq from types import LambdaType n = int(input()) allies = list(map(int, input().split())) enemies = list(map(lambda x: int(x) // 2, input().split())) ans = n + 1 for s in range(n): que = [(allies[i], 0) for i in range(n)] heapq.heapify(que) temp = 0 for j in range(n): u = heapq.heappop(que) heapq.heappush(que, (u[0] + enemies[(s + j) % n], u[1] + 1)) temp = max(temp, u[1] + 1) ans = min(ans, temp) print(ans)