結果

問題 No.2386 Udon Coupon (Easy)
コンテスト
ユーザー hato336
提出日時 2023-07-21 21:44:05
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 200 ms / 2,000 ms
+ 381µs
コード長 467 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 232 ms
コンパイル使用メモリ 96,084 KB
実行使用メモリ 93,680 KB
最終ジャッジ日時 2026-09-02 00:13:31
合計ジャッジ時間 10,145 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
n = int(input())
a,b,c = map(int,input().split())

ans =-1
for i in range(2*10**5+1):
    if n < i*3:
        continue
    temp = a * i
    ntemp = n - 3 * i
    if 2*b >= c:
        temp += (ntemp // 5) * b
    else:
        temp += (ntemp // 10) * c
        ntemp %= 10
        temp += (ntemp // 5) * b
    ans = max(ans,temp)
print(ans)
0