結果
| 問題 |
No.2386 Udon Coupon (Easy)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-21 21:37:07 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 58 ms / 2,000 ms |
| コード長 | 236 bytes |
| コンパイル時間 | 232 ms |
| コンパイル使用メモリ | 82,520 KB |
| 実行使用メモリ | 62,464 KB |
| 最終ジャッジ日時 | 2024-09-21 22:57:46 |
| 合計ジャッジ時間 | 3,335 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 |
ソースコード
n=int(input())
a,b,c=map(int,input().split())
dp=[0]*(n+1)
for i in range(n):
if i+3<=n:
dp[i+3]=max(dp[i+3],dp[i]+a)
if i+5<=n:
dp[i+5]=max(dp[i+5],dp[i]+b)
if i+10<=n:
dp[i+10]=max(dp[i+10],dp[i]+c)
print(max(dp))