結果

問題 No.2386 Udon Coupon (Easy)
ユーザー miho-4miho-4
提出日時 2023-07-21 21:32:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 285 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 81,652 KB
実行使用メモリ 63,572 KB
最終ジャッジ日時 2023-10-21 21:22:57
合計ジャッジ時間 3,270 ms
ジャッジサーバーID
(参考情報)
judge10 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,424 KB
testcase_01 AC 39 ms
53,424 KB
testcase_02 AC 37 ms
53,424 KB
testcase_03 AC 37 ms
53,424 KB
testcase_04 AC 36 ms
53,424 KB
testcase_05 AC 37 ms
53,424 KB
testcase_06 AC 38 ms
53,424 KB
testcase_07 AC 55 ms
63,572 KB
testcase_08 AC 37 ms
53,424 KB
testcase_09 AC 37 ms
53,424 KB
testcase_10 AC 50 ms
62,368 KB
testcase_11 AC 47 ms
62,092 KB
testcase_12 AC 46 ms
61,032 KB
testcase_13 AC 46 ms
61,364 KB
testcase_14 AC 52 ms
63,296 KB
testcase_15 AC 47 ms
61,420 KB
testcase_16 AC 47 ms
61,032 KB
testcase_17 AC 51 ms
63,372 KB
testcase_18 AC 45 ms
60,508 KB
testcase_19 AC 49 ms
61,996 KB
testcase_20 AC 51 ms
62,956 KB
testcase_21 AC 53 ms
63,376 KB
testcase_22 AC 52 ms
62,800 KB
testcase_23 AC 51 ms
62,724 KB
testcase_24 AC 48 ms
62,236 KB
testcase_25 AC 49 ms
62,880 KB
testcase_26 AC 51 ms
63,320 KB
testcase_27 AC 51 ms
63,460 KB
testcase_28 AC 47 ms
60,660 KB
testcase_29 AC 50 ms
62,416 KB
testcase_30 AC 50 ms
62,008 KB
testcase_31 AC 50 ms
62,684 KB
testcase_32 AC 50 ms
61,996 KB
testcase_33 AC 53 ms
63,560 KB
testcase_34 AC 46 ms
60,728 KB
testcase_35 AC 51 ms
63,052 KB
testcase_36 AC 50 ms
61,436 KB
testcase_37 AC 53 ms
63,172 KB
testcase_38 AC 46 ms
60,808 KB
testcase_39 AC 45 ms
60,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a,b,c=map(int,input().split())

dp=[-1]*(n+1)
dp[0]=0
for i in range(n+1):
  if 0<=i-3 and 0<=dp[i-3]:
    dp[i]=max(dp[i],dp[i-3]+a)
  if 0<=i-5 and 0<=dp[i-5]:
    dp[i]=max(dp[i],dp[i-5]+b)
  if 0<=i-10 and 0<=dp[i-10]:
    dp[i]=max(dp[i],dp[i-10]+c)

print(max(dp))
0