結果

問題 No.1947 質より種類数
ユーザー ああいいああいい
提出日時 2022-05-20 23:55:08
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 339 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 81,796 KB
実行使用メモリ 80,504 KB
最終ジャッジ日時 2023-10-20 14:52:25
合計ジャッジ時間 21,084 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,452 KB
testcase_01 AC 38 ms
53,256 KB
testcase_02 AC 38 ms
53,256 KB
testcase_03 AC 39 ms
53,256 KB
testcase_04 AC 139 ms
72,480 KB
testcase_05 AC 126 ms
70,416 KB
testcase_06 AC 116 ms
70,412 KB
testcase_07 AC 128 ms
70,416 KB
testcase_08 AC 151 ms
72,480 KB
testcase_09 AC 238 ms
75,612 KB
testcase_10 AC 188 ms
75,612 KB
testcase_11 AC 269 ms
75,684 KB
testcase_12 AC 343 ms
75,620 KB
testcase_13 AC 120 ms
75,612 KB
testcase_14 AC 884 ms
77,384 KB
testcase_15 AC 481 ms
76,252 KB
testcase_16 AC 1,238 ms
78,060 KB
testcase_17 AC 907 ms
78,424 KB
testcase_18 TLE -
testcase_19 TLE -
testcase_20 AC 1,048 ms
78,932 KB
testcase_21 TLE -
testcase_22 AC 130 ms
75,700 KB
testcase_23 AC 599 ms
77,548 KB
testcase_24 AC 325 ms
74,096 KB
testcase_25 AC 265 ms
72,460 KB
testcase_26 AC 319 ms
68,364 KB
testcase_27 AC 221 ms
70,412 KB
testcase_28 AC 634 ms
72,460 KB
testcase_29 TLE -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

l = []
for _ in range(N):
    v,w = map(int,input().split())
    l.append((v,w))
dp = [0] * (V + 1)
for v,w in l:
    nx = dp.copy()
    for i in range(V + 1):
        for j in range(1,(V - i) // v + 1):
            nx[i + j * v] = max(nx[i + j * v],dp[i] + C + w * j)
        
    dp = nx
print(max(dp))
0