結果

問題 No.2386 Udon Coupon (Easy)
ユーザー sotanishy
提出日時 2023-07-21 22:19:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 47 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 52,480 KB
最終ジャッジ日時 2024-09-21 23:49:50
合計ジャッジ時間 3,283 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N = int(input())
A, B, C = map(int, input().split())
a = max(10*A, 6*B, 3*C)
D = 0
for x in range(11):
    for y in range(7):
        for z in range(4):
            n = 3*x+5*y+10*z
            if n > N:
                continue
            rem = (N-n)//30*a
            D = max(D, A*x+B*y+C*z+rem)
print(D)
0