結果
問題 |
No.2386 Udon Coupon (Easy)
|
ユーザー |
![]() |
提出日時 | 2025-04-16 15:43:32 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 686 bytes |
コンパイル時間 | 621 ms |
コンパイル使用メモリ | 81,792 KB |
実行使用メモリ | 60,800 KB |
最終ジャッジ日時 | 2025-04-16 15:46:31 |
合計ジャッジ時間 | 3,016 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 WA * 10 |
ソースコード
n = int(input()) a, b, c = map(int, input().split()) max_discount = 0 max_c10 = n // 10 for c10 in range(max_c10 + 1): remaining = n - 10 * c10 if remaining < 0: continue current_c = c10 * c y_max = remaining // 5 best_5_3 = 0 # Check y in [y_max-4, y_max] start_y = max(0, y_max - 4) for y in range(start_y, y_max + 1): rem_after_5 = remaining - 5 * y if rem_after_5 < 0: continue x = rem_after_5 // 3 total = b * y + a * x if total > best_5_3: best_5_3 = total total_d = current_c + best_5_3 if total_d > max_discount: max_discount = total_d print(max_discount)