結果

問題 No.555 世界史のレポート
ユーザー H3PO4H3PO4
提出日時 2020-09-23 08:55:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 423 ms / 2,000 ms
コード長 257 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,572 KB
実行使用メモリ 31,412 KB
最終ジャッジ日時 2023-09-09 21:15:58
合計ジャッジ時間 7,657 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
29,724 KB
testcase_01 AC 125 ms
29,748 KB
testcase_02 AC 126 ms
29,800 KB
testcase_03 AC 126 ms
29,824 KB
testcase_04 AC 128 ms
29,828 KB
testcase_05 AC 128 ms
29,816 KB
testcase_06 AC 128 ms
29,796 KB
testcase_07 AC 129 ms
29,792 KB
testcase_08 AC 129 ms
29,736 KB
testcase_09 AC 130 ms
29,792 KB
testcase_10 AC 367 ms
30,908 KB
testcase_11 AC 362 ms
31,220 KB
testcase_12 AC 339 ms
31,148 KB
testcase_13 AC 310 ms
31,152 KB
testcase_14 AC 348 ms
31,032 KB
testcase_15 AC 359 ms
31,036 KB
testcase_16 AC 326 ms
31,132 KB
testcase_17 AC 336 ms
31,036 KB
testcase_18 AC 355 ms
31,412 KB
testcase_19 AC 423 ms
31,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

N = int(input())
C, V = map(int, input().split())
MAX = 10 ** 8

dp = np.full(2 * N, MAX)
dp[1] = 0
for i in range(1, N):
    np.minimum(dp[i * 2::i], dp[i] + C + V * np.arange(1, (2 * N - 1) // i), out=dp[i * 2::i])
print(dp[N:].min())
0