結果

問題 No.2386 Udon Coupon (Easy)
ユーザー sotanishy
提出日時 2023-07-21 21:51:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 313 bytes
コンパイル時間 183 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 59,412 KB
最終ジャッジ日時 2024-09-21 23:21:24
合計ジャッジ時間 3,340 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34 WA * 3
権限があれば一括ダウンロードができます

ソースコード

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)
base = N//30*a
N %= 30
D = 0
for x in range(N+1):
    for y in range(N+1):
        for z in range(N+1):
            if 3*x+5*y+10*z <= N:
                D = max(D, A*x+B*y+C*z)
D += base
print(D)
0