結果
| 問題 | No.2386 Udon Coupon (Easy) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-11-16 21:17:55 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 512 bytes |
| 記録 | |
| コンパイル時間 | 114 ms |
| コンパイル使用メモリ | 64,304 KB |
| 実行使用メモリ | 58,656 KB |
| 最終ジャッジ日時 | 2026-11-16 21:18:20 |
| 合計ジャッジ時間 | 20,255 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 TLE * 5 |
ソースコード
N = int(input())
A, B, C = map(int, input().split())
ans = 0
if 2*B >= C:
for a in range(0, (N//3) + 1):
nokori = N - 3*a
# a 枚の A円引き、nokori//5 枚のB円引き
sub = a*A + (nokori//5)*B
ans = max(ans, sub)
else:
for a in range(0, (N//3) + 1):
nokori = N - 3*a
for b in range(0, (nokori//5) + 1):
# a枚のA
# nokori//5
sub = a*A + b*B + ((N - 3*a - 5*b)//10)*C
ans = max(ans, sub)
print(ans)