結果
| 問題 |
No.2386 Udon Coupon (Easy)
|
| コンテスト | |
| ユーザー |
えなじ~🔋▶️
|
| 提出日時 | 2023-07-21 21:32:30 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 58 ms / 2,000 ms |
| コード長 | 347 bytes |
| コンパイル時間 | 200 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 62,976 KB |
| 最終ジャッジ日時 | 2024-09-21 22:51:00 |
| 合計ジャッジ時間 | 3,230 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 |
ソースコード
N = int(input())
A, B, C = map(int, input().split())
discount = [0 for _ in range(N+1)]
for i in range(1,N+1):
if i>=3:
discount[i] = max(discount[i], discount[i-3] + A)
if i>=5:
discount[i] = max(discount[i], discount[i-5] + B)
if i>=10:
discount[i] = max(discount[i], discount[i-10] + C)
print(max(discount))
えなじ~🔋▶️