結果

問題 No.1947 質より種類数
ユーザー とりゐとりゐ
提出日時 2022-05-20 21:52:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,003 ms / 2,000 ms
コード長 242 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 81,736 KB
実行使用メモリ 76,088 KB
最終ジャッジ日時 2023-10-20 12:25:41
合計ジャッジ時間 6,463 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,444 KB
testcase_01 AC 40 ms
53,444 KB
testcase_02 AC 36 ms
53,444 KB
testcase_03 AC 41 ms
53,444 KB
testcase_04 AC 57 ms
64,424 KB
testcase_05 AC 54 ms
64,432 KB
testcase_06 AC 54 ms
64,452 KB
testcase_07 AC 53 ms
64,432 KB
testcase_08 AC 55 ms
64,432 KB
testcase_09 AC 60 ms
64,432 KB
testcase_10 AC 57 ms
64,432 KB
testcase_11 AC 70 ms
68,948 KB
testcase_12 AC 65 ms
66,480 KB
testcase_13 AC 56 ms
64,432 KB
testcase_14 AC 171 ms
76,088 KB
testcase_15 AC 113 ms
76,080 KB
testcase_16 AC 200 ms
76,088 KB
testcase_17 AC 241 ms
73,076 KB
testcase_18 AC 368 ms
76,076 KB
testcase_19 AC 237 ms
76,068 KB
testcase_20 AC 198 ms
76,068 KB
testcase_21 AC 295 ms
76,064 KB
testcase_22 AC 68 ms
70,792 KB
testcase_23 AC 174 ms
71,028 KB
testcase_24 AC 57 ms
66,884 KB
testcase_25 AC 51 ms
62,376 KB
testcase_26 AC 51 ms
62,004 KB
testcase_27 AC 52 ms
62,004 KB
testcase_28 AC 52 ms
64,440 KB
testcase_29 AC 229 ms
68,912 KB
testcase_30 AC 176 ms
68,928 KB
testcase_31 AC 37 ms
53,444 KB
testcase_32 AC 36 ms
53,444 KB
testcase_33 AC 46 ms
62,000 KB
testcase_34 AC 1,003 ms
76,088 KB
testcase_35 AC 243 ms
68,912 KB
testcase_36 AC 175 ms
68,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,V,c=map(int,input().split())
dp=[-10**9]*(V+1)
dp[0]=0
for _ in range(n):
  v,w=map(int,input().split())
  for s in range(v):
    mx=-10**9
    for i in range(s,V+1,v):
      mx,dp[i]=max(dp[i]+c,mx),max(dp[i],mx)
      mx+=w
print(max(dp))
0