結果

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

ソースコード

diff #

N = int(input())
A, B, C = map(int, input().split())

ans = N//30 * max(A * 10, B * 6, C * 3)
N %= 30
temp = 0
for a in range(11):
    for b in range(7):
        for c in range(4):
            if 3 * a + 5 * b + 10 * c > N:
                continue
            temp = max(temp, A * a + B * b + C * c)
print(ans + temp)
0