結果
| 問題 | No.555 世界史のレポート |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-09-15 00:04:25 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 329 bytes |
| 記録 | |
| コンパイル時間 | 284 ms |
| コンパイル使用メモリ | 82,320 KB |
| 実行使用メモリ | 477,880 KB |
| 最終ジャッジ日時 | 2024-12-15 12:59:50 |
| 合計ジャッジ時間 | 23,135 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 TLE * 6 |
ソースコード
from heapq import heapify, heappop, heappush
n = int(input())
c, v = map(int, input().split())
H = [(c, 1, 1)]
heapify(H)
while H:
cost, num, c_num = heappop(H)
if num >= n:
print(cost)
break
if c_num != num:
heappush(H, (cost + c, num, num))
heappush(H, (cost + v, num + c_num, c_num))