結果
| 問題 | No.2386 Udon Coupon (Easy) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-21 21:44:05 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 95 ms / 2,000 ms |
| コード長 | 467 bytes |
| 記録 | |
| コンパイル時間 | 137 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 86,400 KB |
| 最終ジャッジ日時 | 2026-04-10 04:48:57 |
| 合計ジャッジ時間 | 5,413 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 |
ソースコード
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)