結果

問題 No.2386 Udon Coupon (Easy)
ユーザー lam6er
提出日時 2025-04-16 15:37:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 478 bytes
コンパイル時間 322 ms
コンパイル使用メモリ 81,600 KB
実行使用メモリ 62,060 KB
最終ジャッジ日時 2025-04-16 15:43:16
合計ジャッジ時間 2,983 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

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

max_total = 0

max_x = n // 10
for x in range(max_x + 1):
    rem = n - 10 * x
    if rem < 0:
        continue
    y_max = rem // 5
    start_y = max(0, y_max - 4)
    for y in range(start_y, y_max + 1):
        if 5 * y > rem:
            continue
        rem_after = rem - 5 * y
        z = rem_after // 3
        total = c * x + b * y + a * z
        if total > max_total:
            max_total = total

print(max_total)
0