結果

問題 No.555 世界史のレポート
ユーザー titiatitia
提出日時 2024-03-31 03:24:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 707 ms / 2,000 ms
コード長 227 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 11,904 KB
最終ジャッジ日時 2024-03-31 03:24:40
合計ジャッジ時間 7,146 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
9,856 KB
testcase_01 AC 28 ms
9,856 KB
testcase_02 AC 29 ms
9,856 KB
testcase_03 AC 33 ms
9,856 KB
testcase_04 AC 36 ms
9,856 KB
testcase_05 AC 33 ms
9,856 KB
testcase_06 AC 34 ms
9,856 KB
testcase_07 AC 36 ms
9,856 KB
testcase_08 AC 36 ms
9,856 KB
testcase_09 AC 39 ms
9,856 KB
testcase_10 AC 498 ms
11,264 KB
testcase_11 AC 558 ms
11,392 KB
testcase_12 AC 496 ms
11,264 KB
testcase_13 AC 428 ms
11,136 KB
testcase_14 AC 514 ms
11,392 KB
testcase_15 AC 563 ms
11,392 KB
testcase_16 AC 457 ms
11,136 KB
testcase_17 AC 499 ms
11,264 KB
testcase_18 AC 576 ms
11,392 KB
testcase_19 AC 707 ms
11,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
C,V=map(int,input().split())

DP=[1<<63]*(N+1)
DP[1]=0

for i in range(1,N):
    x=DP[i]

    now=x+C
    v=i

    while v<=N:
        v+=i
        now+=V
        DP[min(v,N)]=min(DP[min(v,N)],now)

print(DP[-1])
0