結果

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

ソースコード

diff #

N=int(input())
A,B,C=map(int,input().split())
ans=0
for a in range(N):
    tmp=0
    if a*3>N:
        break
    m=N-a*3
    tmp+=A*a
    if 2*B>C:
        tmp+=B*(m//5)
    else:
        c=m//10
        tmp+=C*c
        m=m-c*10
        tmp+=B*(m//5)
    ans=max(ans,tmp)
print(ans)
0